Merge pull request #29336 from rallytime/bp-29276

Back-port #29276 to 2015.5
This commit is contained in:
Mike Place 2015-12-02 12:37:42 -07:00
commit 51ea88d489

View file

@ -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