From 71014ab01e54fc5f84f0ec256ea9822de8602ef6 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 2 Jun 2015 13:30:14 -0500 Subject: [PATCH] Fix command building for scp if ssh --- lib/ansible/plugins/connections/ssh.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/plugins/connections/ssh.py b/lib/ansible/plugins/connections/ssh.py index 426dc6b49d0..b3ada343c04 100644 --- a/lib/ansible/plugins/connections/ssh.py +++ b/lib/ansible/plugins/connections/ssh.py @@ -407,12 +407,12 @@ class Connection(ConnectionBase): if C.DEFAULT_SCP_IF_SSH: cmd.append('scp') - cmd += self._common_args - cmd.append(in_path,host + ":" + pipes.quote(out_path)) + cmd.extend(self._common_args) + cmd.extend([in_path, '{0}:{1}'.format(host, pipes.quote(out_path))]) indata = None else: cmd.append('sftp') - cmd += self._common_args + cmd.extend(self._common_args) cmd.append(host) indata = "put {0} {1}\n".format(pipes.quote(in_path), pipes.quote(out_path)) @@ -440,12 +440,12 @@ class Connection(ConnectionBase): if C.DEFAULT_SCP_IF_SSH: cmd.append('scp') - cmd += self._common_args - cmd += ('{0}:{1}'.format(host, in_path), out_path) + cmd.extend(self._common_args) + cmd.extend(['{0}:{1}'.format(host, in_path), out_path]) indata = None else: cmd.append('sftp') - cmd += self._common_args + cmd.extend(self._common_args) cmd.append(host) indata = "get {0} {1}\n".format(in_path, out_path)