Commit 63e1b902 authored by Nikos Skalkotos's avatar Nikos Skalkotos

In rsync make src and dest labels configurable

parent 033007ec
......@@ -385,7 +385,7 @@ class BundleVolume(object):
rsync.exclude(excl)
rsync.archive().hard_links().xattrs().sparse().acls()
rsync.run('/', target)
rsync.run('/', target, 'host', 'tmp image')
# We need to replace the old UUID referencies with the new
# ones in grub configuration files and /etc/fstab for file
......
......@@ -82,7 +82,7 @@ class Rsync:
self._exclude = []
self._options = ['-v']
def run(self, src, dest):
def run(self, src, dest, slabel='source', dlabel='destination'):
"""Run the actual command"""
cmd = []
cmd.append('rsync')
......@@ -90,7 +90,8 @@ class Rsync:
for i in self._exclude:
cmd.extend(['--exclude', i])
self._out.output("Calculating total number of host files ...", False)
self._out.output("Calculating total number of %s files ..." % slabel,
False)
# If you don't specify a destination, rsync will list the source files.
dry_run = subprocess.Popen(cmd + [src], shell=False,
......@@ -106,8 +107,8 @@ class Rsync:
self._out.success("%d" % total)
progress = self._out.Progress(total,
"Copying host files into the image")
progress = self._out.Progress(total, "Copying %s files to %s" %
(slabel, dlabel))
run = subprocess.Popen(cmd + [src, dest], shell=False,
stdout=subprocess.PIPE, bufsize=0)
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment