summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/connection/ssh.py
diff options
context:
space:
mode:
authorAlberto Murillo <alberto.murillo.silva@intel.com>2016-11-30 22:10:49 -0600
committerToshio Kuratomi <a.badger@gmail.com>2016-11-30 20:10:49 -0800
commit7542dae26baa0d74dbb097a1f7c4b730375e8b4d (patch)
tree5755fb9685bc9107f064181eb71acefe5401f5db /lib/ansible/plugins/connection/ssh.py
parent2b13ad0ae809e0e9ed05749c4dda74939addd440 (diff)
downloadansible-7542dae26baa0d74dbb097a1f7c4b730375e8b4d.tar.gz
Fix fetching files with scp (#18673)
Commit ec2521f intended to fix the scp command to fetch files from a remote machine but it has src and dest swapped. This change correctly treats src as the location in the remote machine and dest as the location in the local machine. Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
Diffstat (limited to 'lib/ansible/plugins/connection/ssh.py')
-rw-r--r--lib/ansible/plugins/connection/ssh.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
index b4ed0398d1..799120f1e1 100644
--- a/lib/ansible/plugins/connection/ssh.py
+++ b/lib/ansible/plugins/connection/ssh.py
@@ -629,7 +629,7 @@ class Connection(ConnectionBase):
in_data = u"{0} {1} {2}\n".format(sftp_action, shlex_quote(in_path), shlex_quote(out_path))
elif method == 'scp':
if sftp_action == 'get':
- cmd = self._build_command('scp', u'{0}:{1}'.format(host, shlex_quote(out_path)), in_path)
+ cmd = self._build_command('scp', u'{0}:{1}'.format(host, shlex_quote(in_path)), out_path)
else:
cmd = self._build_command('scp', in_path, u'{0}:{1}'.format(host, shlex_quote(out_path)))
in_data = None