TPE-487 Fix of attempt to hack rsync failed. 73/163673/1
authorhyokeun <hyokeun.jeon@samsung.com>
Wed, 13 Dec 2017 01:37:22 +0000 (10:37 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Wed, 13 Dec 2017 01:37:22 +0000 (10:37 +0900)
Change-Id: Ia3cd57b2972bc9ef6100b9127c47180abbf5c93d

common/utils.py

index 13ffc85..7130040 100644 (file)
@@ -138,6 +138,13 @@ def sync(source, destination, remove=True, hardlinks=False):
 
     # Through rsync protocol
     if destination.startswith('rsync:'):
+
+        # Cut trailing slash due to error (attempt to hack rsync failed)
+        if os.path.isdir(source):
+            if source.endswith("/"):
+                source = source[:-1]
+            source = "%s/*" % source
+
         cmd = "rsync -av --delay-updates %s/ %s" % (source, destination)
 
         try: