retry sync function because of rsync error
authorYonghee Han <onstudy@samsung.com>
Tue, 12 Apr 2016 07:29:45 +0000 (16:29 +0900)
committerYonghee Han <onstudy@samsung.com>
Tue, 12 Apr 2016 07:29:45 +0000 (16:29 +0900)
Change-Id: I353a755c25105dbf3e3b0246748ad29233ff178e

job_imager.py

index 88b4d81..b4586d4 100755 (executable)
@@ -283,9 +283,17 @@ def main():
 
     convert_image_dir(os.path.join(sync_src, 'images'),
                       fields['repo'], fields['name'])
-    if sync(sync_src, sync_dest):
+    for loop in range(2):
+        if sync(sync_src, sync_dest):
+            print "Retry sync %s to %s" % (sync_src, sync_dest)
+            status = 'failed'
+        else:
+            print "Success sync %s to %s" % (sync_src, sync_dest)
+            status = 'success'
+            break;
+
+    if(status == 'failed'):
         print "Error: unable to sync %s to %s" % (sync_src, sync_dest)
-        status = 'failed'
 
     xml_string = get_xml(os.path.join(outdir, build_id), name)