1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Added some pipes.quote ops to make sure paths with spaces in them are ok.

This commit is contained in:
Michael DeHaan 2013-07-20 18:28:11 -04:00
parent 508c1d8256
commit 419661542b

View file

@ -215,11 +215,11 @@ class Connection(object):
if C.DEFAULT_SCP_IF_SSH: if C.DEFAULT_SCP_IF_SSH:
cmd += ["scp"] + self.common_args cmd += ["scp"] + self.common_args
cmd += [in_path,self.host + ":" + out_path] cmd += [in_path,self.host + ":" + pipes.quote(out_path)]
indata = None indata = None
else: else:
cmd += ["sftp"] + self.common_args + [self.host] cmd += ["sftp"] + self.common_args + [self.host]
indata = "put %s %s\n" % (in_path, out_path) indata = "put %s %s\n" % (pipes.quote(in_path), pipes.quote(out_path))
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout=subprocess.PIPE, stderr=subprocess.PIPE)