Bug 1171026: Fix exit code for phone-builder image. r=garndt a=garndt
authorWander Lairson Costa <wcosta@mozilla.com>
Wed, 03 Jun 2015 17:55:04 -0300
changeset 269705 5a47d2483d4501ad71e47882249d811de7e1528f
parent 269702 81a280e44703c8caa88b2ddd128406fd9a660159
child 269862 012bdf413c73c305db4936041fe81a0757468827
push id2542
push userwcosta@mozilla.com
push dateWed, 03 Jun 2015 20:56:21 +0000
reviewersgarndt, garndt
bugs1171026
milestone41.0a1
Bug 1171026: Fix exit code for phone-builder image. r=garndt a=garndt If the task fails, validate_task still would return a successful exit code.
testing/docker/phone-builder/VERSION
testing/docker/phone-builder/bin/validate_task.py
--- a/testing/docker/phone-builder/VERSION
+++ b/testing/docker/phone-builder/VERSION
@@ -1,1 +1,1 @@
-0.0.14
+0.0.15
--- a/testing/docker/phone-builder/bin/validate_task.py
+++ b/testing/docker/phone-builder/bin/validate_task.py
@@ -48,18 +48,20 @@ def check_task(task):
 def main():
     taskid = os.getenv('TASK_ID')
 
     # If the task id is None, we assume we are running docker locally
     if taskid is not None:
         task = get_task(taskid)
         ret = check_task(task)
         if ret != 0:
-            sys.exit(ret)
+            return ret
 
     if len(sys.argv) > 1:
         try:
-            subprocess.call(sys.argv[1:], shell=True)
+            return subprocess.call(sys.argv[1:], shell=True)
         except subprocess.CalledProcessError as e:
-            sys.exit(e.returncode)
+            return e.returncode
+
+    return 0
 
 if __name__ == '__main__':
-    main()
+    sys.exit(main())