mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Prevent adding port twice when adding entry in known hosts
Check hostname value inside remote_host dictionary to find out ':'. In that case don't append port
This commit is contained in:
parent
14e94b3593
commit
3a0e19debb
1 changed files with 1 additions and 1 deletions
|
@ -919,7 +919,7 @@ def set_known_host(user=None,
|
|||
if key:
|
||||
remote_host = {'hostname': hostname, 'enc': enc, 'key': key}
|
||||
|
||||
if hash_known_hosts or port == DEFAULT_SSH_PORT:
|
||||
if hash_known_hosts or port == DEFAULT_SSH_PORT or ':' in remote_host['hostname']:
|
||||
line = '{hostname} {enc} {key}\n'.format(**remote_host)
|
||||
else:
|
||||
remote_host['port'] = port
|
||||
|
|
Loading…
Add table
Reference in a new issue