To use "--delay-updates" for rsync for atomic sync
authorJF Ding <jian-feng.ding@intel.com>
Fri, 15 Aug 2014 11:18:07 +0000 (19:18 +0800)
committerEduard Bartosh <eduard.bartosh@intel.com>
Tue, 23 Sep 2014 10:10:22 +0000 (13:10 +0300)
Sometime, the users noticed the images in download server have wrong
md5sum and cannot boot. It's possible it's a partial downloaded file,
caused by atomic rsyncing problem. This rsync command line option
will help it.

Change-Id: I9ef2344cd01594fb33080feaaa193714cb4a5570
Signed-off-by: JF Ding <jian-feng.ding@intel.com>
common/utils.py

index 0e3c468..70769f8 100644 (file)
@@ -118,7 +118,7 @@ def sync(source, destination, remove=True):
 
     # Through rsync protocol
     if destination.startswith('rsync:'):
-        cmd = "rsync -av %s/ %s" % (source, destination)
+        cmd = "rsync -av --delay-updates %s/ %s" % (source, destination)
 
         try:
             ret_code = subprocess.call(cmd, shell = True)