mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Salt-SSH deal with raw IPv6 addresses
This commit is contained in:
parent
878946d0f8
commit
dd1223468b
1 changed files with 6 additions and 1 deletions
|
@ -66,7 +66,8 @@ class Shell(object):
|
|||
sudo_user=None,
|
||||
remote_port_forwards=None):
|
||||
self.opts = opts
|
||||
self.host = host
|
||||
# ssh <ipv6>, but scp [<ipv6]:/path
|
||||
self.host = host.strip('[]')
|
||||
self.user = user
|
||||
self.port = port
|
||||
self.passwd = str(passwd) if passwd else passwd
|
||||
|
@ -320,6 +321,10 @@ class Shell(object):
|
|||
if makedirs:
|
||||
self.exec_cmd('mkdir -p {0}'.format(os.path.dirname(remote)))
|
||||
|
||||
# scp needs [<ipv6}
|
||||
if ':' in self.host:
|
||||
self.host = '[{0}]'.format(self.host)
|
||||
|
||||
cmd = '{0} {1}:{2}'.format(local, self.host, remote)
|
||||
cmd = self._cmd_str(cmd, ssh='scp')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue