From: hyokeun Date: Fri, 11 Aug 2017 00:49:18 +0000 (+0900) Subject: SR-SYNC: Wait until the dashboard finalizing snapshot info X-Git-Tag: submit/trunk/20190927.012743~336 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22ceb7ffb20017c940577e9d826c9785cb633548;p=services%2Fjenkins-scripts.git SR-SYNC: Wait until the dashboard finalizing snapshot info Problem: No data if the dashboard has not been updated snapshot info. Cause: Waiting for the completion of post-snapshot job or BUILD-MONITOR. Fix: Wait some time and request again. Change-Id: Ia880c61e7eb3b1792be4f35141f4618aa2d98ed9 --- diff --git a/job_submit_request_sync.py b/job_submit_request_sync.py index 5b76e22..b846b1a 100644 --- a/job_submit_request_sync.py +++ b/job_submit_request_sync.py @@ -117,7 +117,15 @@ def main(): project = os.getenv('UPSTREAM_OBS_PROJECT') #target_project = os.getenv('TARGET_PROJECT') # Retrieve SR list of the snapshot from dashboard - official_data = request_sr_list_for_snapshot(project, snapshot, reason) + retry_count = 10 + while retry_count > 0: + official_data = request_sr_list_for_snapshot(project, snapshot, reason) + if len(official_data['requests'][0]['submit_list']) <= 0: + print 'Fetching dashboard data failed, retrying...' + retry_count -= 1; sleep(180); continue + break + if retry_count <= 0: + raise Exception('Fail to fetch snapshot info from dashboard') elif os.getenv('TRIGGER_INFO', None): manual_trigger = trigger_info(os.getenv('TRIGGER_INFO')) snapshot = 'SR-SYNC'