mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
modules.network: standardize util check
This commit is contained in:
parent
3675f1e67e
commit
e33f5c1fa4
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue