modules.network: standardize util check

This commit is contained in:
Justin Findlay 2019-03-29 09:33:59 -07:00
parent 3675f1e67e
commit e33f5c1fa4
No known key found for this signature in database
GPG key ID: 423725EEF5A74B6F

View file

@ -823,6 +823,7 @@ def active_tcp():
return {}
@salt.utils.decorators.path.which('traceroute')
def traceroute(host):
'''
Performs a traceroute to a 3rd party host
@ -840,12 +841,7 @@ def traceroute(host):
salt '*' network.traceroute archlinux.org
'''
ret = []
if not salt.utils.path.which('traceroute'):
log.info('This minion does not have traceroute installed')
return ret
cmd = 'traceroute {0}'.format(salt.utils.network.sanitize_host(host))
out = __salt__['cmd.run'](cmd)
# Parse version of traceroute