Fix a bug in the way rsync copies files
authorNikos Skalkotos <skalkoto@grnet.gr>
Thu, 21 Mar 2013 12:21:56 +0000 (14:21 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Thu, 21 Mar 2013 13:44:15 +0000 (15:44 +0200)
The exclude patterns were wrong and they excluded more files than
they should.

image_creator/bundle_volume.py

index a6fc27a..9a9a366 100644 (file)
@@ -387,8 +387,7 @@ class BundleVolume(object):
 
                 rsync = Rsync(self.out)
 
-                # Excluded paths need to be relative to the source
-                for excl in map(lambda p: p[1:], excluded + [image]):
+                for excl in excluded + [image]:
                     rsync.exclude(excl)
 
                 rsync.archive().hard_links().xattrs().sparse().acls()
@@ -467,8 +466,8 @@ class BundleVolume(object):
         dirname = os.path.dirname(image)
         self.out.output("Examining available space ...", False)
         if free_space(dirname) <= size:
-            raise FatalError('Not enough space under %s to host the image' %
-                             dirname)
+            raise FatalError("Not enough space under %s to host the temporary "
+                             "image" % dirname)
         self.out.success("sufficient")
 
         self._create_filesystems(image, partitions)