Revision 63e1b902 image_creator/rsync.py
b/image_creator/rsync.py | ||
---|---|---|
82 | 82 |
self._exclude = [] |
83 | 83 |
self._options = ['-v'] |
84 | 84 |
|
85 |
def run(self, src, dest): |
|
85 |
def run(self, src, dest, slabel='source', dlabel='destination'):
|
|
86 | 86 |
"""Run the actual command""" |
87 | 87 |
cmd = [] |
88 | 88 |
cmd.append('rsync') |
... | ... | |
90 | 90 |
for i in self._exclude: |
91 | 91 |
cmd.extend(['--exclude', i]) |
92 | 92 |
|
93 |
self._out.output("Calculating total number of host files ...", False) |
|
93 |
self._out.output("Calculating total number of %s files ..." % slabel, |
|
94 |
False) |
|
94 | 95 |
|
95 | 96 |
# If you don't specify a destination, rsync will list the source files. |
96 | 97 |
dry_run = subprocess.Popen(cmd + [src], shell=False, |
... | ... | |
106 | 107 |
|
107 | 108 |
self._out.success("%d" % total) |
108 | 109 |
|
109 |
progress = self._out.Progress(total, |
|
110 |
"Copying host files into the image")
|
|
110 |
progress = self._out.Progress(total, "Copying %s files to %s" %
|
|
111 |
(slabel, dlabel))
|
|
111 | 112 |
run = subprocess.Popen(cmd + [src, dest], shell=False, |
112 | 113 |
stdout=subprocess.PIPE, bufsize=0) |
113 | 114 |
try: |
Also available in: Unified diff