Merge pull request #38877 from The-Loeki/ssh-ipv6

Salt-SSH client: Don't overwrite self.host w/IPv6 brackets
This commit is contained in:
Mike Place 2017-01-23 08:19:20 -07:00 committed by GitHub
commit 28018fd406

View File

@ -333,10 +333,11 @@ class Shell(object):
self.exec_cmd('mkdir -p {0}'.format(os.path.dirname(remote)))
# scp needs [<ipv6}
if ':' in self.host:
self.host = '[{0}]'.format(self.host)
host = self.host
if ':' in host:
host = '[{0}]'.format(host)
cmd = '{0} {1}:{2}'.format(local, self.host, remote)
cmd = '{0} {1}:{2}'.format(local, host, remote)
cmd = self._cmd_str(cmd, ssh='scp')
logmsg = 'Executing command: {0}'.format(cmd)