Fix unhandled error when tasks are not created draft
authorJohan Lorenzo <jlorenzo@mozilla.com>
Thu, 01 Sep 2016 16:22:29 +0200
changeset 7132 f78c86129ca5f6f6203787cbab2f57309b896efc
parent 7131 288e2965d47f955deef669fa1de2036195826b0f
child 7133 7ca6cb5bc2f7c3b52bd0dc4dc8a98e99f8415d65
push id116
push userjlorenzo@mozilla.com
push dateThu, 01 Sep 2016 14:22:42 +0000
Fix unhandled error when tasks are not created MozReview-Commit-ID: EkES1wE3he1
buildfarm/release/build_status.py
--- a/buildfarm/release/build_status.py
+++ b/buildfarm/release/build_status.py
@@ -1,8 +1,10 @@
+import taskcluster
+
 from kickoff import task_for_revision
 
 import logging
 log = logging.getLogger(__name__)
 
 PLATFORMS_TO_WAIT_ON = (
     {'index_platform_name': 'linux', 'artifact_suffix': 'linux-i686.tar.bz2'},
     {'index_platform_name': 'linux64', 'artifact_suffix': 'linux-x86_64.tar.bz2'},
@@ -20,17 +22,22 @@ def are_en_us_builds_done(index, queue, 
         expected_artifact = 'public/build/{}-{}.en-US.{}'.format(
             release['product'],
             release['version'],
             platform['artifact_suffix']
         )
 
         return {'taskId': task['taskId'], 'expected_artifact': expected_artifact}
 
-    tasks_to_watch = map(map_tasks_ids_and_expected_artifacts, PLATFORMS_TO_WAIT_ON)
+    try:
+        tasks_to_watch = map(map_tasks_ids_and_expected_artifacts, PLATFORMS_TO_WAIT_ON)
+    except taskcluster.exceptions.TaskclusterRestFailure:
+        # Tasks not created yet
+        return False
+
     log.debug('tasks found %s', tasks_to_watch)
 
     if _are_all_tasks_completed(queue, tasks_to_watch) is False:
         log.debug('some tasks not ready yet')
         return False
 
     return _are_all_artifacts_present(queue, tasks_to_watch)