forked from ungleich-public/cdist
support rsync for remote copy
This commit is contained in:
parent
53ca7e7aca
commit
3e6b866cae
1 changed files with 6 additions and 1 deletions
|
@ -77,7 +77,12 @@ class Remote(object):
|
||||||
self.log.debug("Remote transfer: %s -> %s", source, destination)
|
self.log.debug("Remote transfer: %s -> %s", source, destination)
|
||||||
self.rmdir(destination)
|
self.rmdir(destination)
|
||||||
command = self._copy.split()
|
command = self._copy.split()
|
||||||
|
# support rsync by appending a "/" to the source if it's a directory
|
||||||
|
if os.path.isdir(source) == True:
|
||||||
|
command.extend(["-r", source + "/", self.target_host + ":" + destination])
|
||||||
|
else:
|
||||||
command.extend(["-r", source, self.target_host + ":" + destination])
|
command.extend(["-r", source, self.target_host + ":" + destination])
|
||||||
|
|
||||||
self._run_command(command)
|
self._run_command(command)
|
||||||
|
|
||||||
def run_script(self, script, env=None, return_output=False):
|
def run_script(self, script, env=None, return_output=False):
|
||||||
|
|
Loading…
Reference in a new issue