summaryrefslogtreecommitdiff
path: root/morphlib/exts/kvm.write
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-06-09 22:56:33 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-06-09 23:02:58 +0000
commitf2392b7ebb07e23efc5c7f0fe551a87b1ce8ba62 (patch)
treea3e1d634ec96f23669ecd854afa9f4d61f11da0a /morphlib/exts/kvm.write
parent875499bd04626c9eae15185341704e36aae18c43 (diff)
downloadmorph-f2392b7ebb07e23efc5c7f0fe551a87b1ce8ba62.tar.gz
Write extensions: pass -s to rsync
-s, or --protect-args prevents the file path components of destination or source paths being interpreted by the remote shell. This is for wildcards or other shell features, but it breaks when paths have whitespace. We tend to always use absolute paths, so all uses of rsync now pass -s. kvm.write needs it, since the disk can be written to a path with spaces. Nfsboot and ssh-rsync need it because version labels are used, which may have spaces, and temporary directories are used, which could have spaces in weird TMPDIR configurations.
Diffstat (limited to 'morphlib/exts/kvm.write')
-rwxr-xr-xmorphlib/exts/kvm.write2
1 files changed, 1 insertions, 1 deletions
diff --git a/morphlib/exts/kvm.write b/morphlib/exts/kvm.write
index 52768042..67ac40e7 100755
--- a/morphlib/exts/kvm.write
+++ b/morphlib/exts/kvm.write
@@ -94,7 +94,7 @@ class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
self.status(msg='Transferring disk image')
target = '%s:%s' % (ssh_host, vm_path)
with open(raw_disk, 'rb') as f:
- cliapp.runcmd(['rsync', '-zS', raw_disk, target])
+ cliapp.runcmd(['rsync', '-szS', raw_disk, target])
def create_libvirt_guest(self, ssh_host, vm_name, vm_path, autostart):
'''Create the libvirt virtual machine.'''