Bug 1257605 - get_apk.py without version fails. r?sylvestre draft
authorAlex Johnson <me@alex-johnson.net>
Sat, 19 Mar 2016 13:34:07 -0400
changeset 342490 fe1f9693c7c557d7c28266f96553e1e9c0f3845f
parent 342489 b3006e4e09af81825badbad69fa3e8c546c7507c
child 516591 acac16b3124bf3e15e43ad0ff581a8eecf237e9a
push id13426
push userme@alex-johnson.net
push dateSat, 19 Mar 2016 17:36:17 +0000
reviewerssylvestre
bugs1257605
milestone48.0a1
Bug 1257605 - get_apk.py without version fails. r?sylvestre MozReview-Commit-ID: CkH4T9TUryk
.hgignore
testing/mozharness/scripts/get_apk.py
--- 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)