Check error condition before sync repo 97/139097/1
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 17 Jul 2017 09:11:53 +0000 (18:11 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Mon, 17 Jul 2017 09:11:56 +0000 (18:11 +0900)
Problem: Recently we met "host down" exception while creating directories.

Change-Id: I0e31b087176220dbb691f933ce8b7b2ca39d3beb

job_trigger_for_sync_repo.py

index d17f63f..324786b 100644 (file)
@@ -256,9 +256,12 @@ class trigger_for_sync_repo(object):
                             profile['snapshot_version'])
         if not os.path.exists(path) or force_trigger:
             print('-----[trigger sync_repo job for {} ]-----'.format(profile['snapshot_version']))
-            subprocess.call('mkdir -p {}'.format(path), shell=True)
-
-            trigger_next('sync_repo_{}'.format(profile['name']), profile)
+            ret_val = subprocess.call('mkdir -p {}'.format(path), shell=True)
+            if int(ret_val) == 0:
+                trigger_next('sync_repo_{}'.format(profile['name']), profile)
+            else:
+                print 'You got errors. %s' % ret_val
+                return int(ret_val)
 
     def main(self):