Merge branch 'stable-0.1'
[snf-image-creator] / image_creator / bundle_volume.py
index 9cc26d4..ff4861e 100644 (file)
@@ -377,9 +377,15 @@ class BundleVolume(object):
                                          [(mapped[i], filesystem[i].mpoint)
                                          for i in mapped.keys()])
                 exclude = self._to_exclude() + [image]
-                rsync = Rsync('/', target,
-                              map(lambda p: os.path.relpath(p, '/'), exclude))
-                rsync.archive().run(self.out)
+
+                rsync = Rsync(self.out)
+
+                # Excluded paths need to be relative to the source
+                for excl in map(lambda p: os.path.relpath(p, '/'), exclude):
+                    rsync.exclude(excl)
+
+                rsync.archive().hard_links().xattrs().sparse().acls()
+                rsync.run('/', target)
 
                 # We need to replace the old UUID referencies with the new
                 # ones in grub configuration files and /etc/fstab for file