only do reverse dns lookup on ips for salt-ssh

Fixes #48676
This commit is contained in:
Daniel Wallace 2018-07-25 09:48:29 -05:00
parent 1eee4b136b
commit 535fb8f8e7
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

View file

@ -350,7 +350,9 @@ class SSH(object):
return
hostname = self.opts['tgt'].split('@')[-1]
needs_expansion = '*' not in hostname and salt.utils.network.is_reachable_host(hostname)
needs_expansion = '*' not in hostname and \
salt.utils.network.is_reachable_host(hostname) and \
salt.utils.network.is_ip(hostname)
if needs_expansion:
hostname = salt.utils.network.ip_to_host(hostname)
if hostname is None: