Bug 1257605 - get_apk.py without version fails. r?sylvestre
MozReview-Commit-ID: CkH4T9TUryk
--- a/.hgignore
+++ b/.hgignore
@@ -103,16 +103,17 @@ GPATH
^mobile/android/gradle/.gradle
# XCode project cruft
^embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/project.xcworkspace/xcuserdata
^embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/xcuserdata
# Ignore mozharness execution files
^testing/mozharness/.tox/
+^testing/mozharness/apk-download
^testing/mozharness/build/
^testing/mozharness/logs/
^testing/mozharness/.coverage
^testing/mozharness/nosetests.xml
# Ignore tox generated dir
.tox/
old mode 100644
new mode 100755
--- a/testing/mozharness/scripts/get_apk.py
+++ b/testing/mozharness/scripts/get_apk.py
@@ -11,23 +11,21 @@ sys.path.insert(1, os.path.dirname(sys.p
# import the guts
from mozharness.base.script import BaseScript
from mozharness.base.python import VirtualenvMixin
from mozharness.base.script import ScriptMixin
class GetAPK(BaseScript, VirtualenvMixin):
all_actions = [
- 'create-virtualenv',
"test",
'download-apk'
]
default_actions = [
- 'create-virtualenv',
'test'
]
config_options = [
[["--build"], {
"dest": "build",
"help": "Specify build number (default 1)",
"default": "1"
@@ -101,22 +99,23 @@ class GetAPK(BaseScript, VirtualenvMixin
# Called if download fails due to 404 error or some other connection failure
def download_error(self):
self.cleanup()
self.fatal("Download failed!")
# Check the given values are correct
def check_argument(self):
+ if self.config["version"] == "None":
+ if self.config["clean"]:
+ self.cleanup()
+ self.fatal("Version is required")
+
if self.config["clean"]:
self.cleanup()
- if self.config["version"] == "None":
- if self.config["clean"]:
- sys.exit(0)
- self.fatal("Version is required")
if self.config["arch"] not in self.arch_values and not self.config["arch"] == "all":
error = self.config["arch"] + " is not a valid arch. " \
"Try one of the following:"+os.linesep
for arch in self.arch_values:
error += arch + os.linesep
error += "Or don't use the --arch option to download all the archs"
self.fatal(error)