mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix fbsd netstat route on fbsd 10+
This commit is contained in:
parent
244c3bd495
commit
0d49dd3c29
1 changed files with 16 additions and 7 deletions
|
@ -385,13 +385,22 @@ def _netstat_route_freebsd():
|
|||
out = __salt__['cmd.run'](cmd, python_shell=True)
|
||||
for line in out.splitlines():
|
||||
comps = line.split()
|
||||
ret.append({
|
||||
'addr_family': 'inet',
|
||||
'destination': comps[0],
|
||||
'gateway': comps[1],
|
||||
'netmask': comps[2],
|
||||
'flags': comps[3],
|
||||
'interface': comps[5]})
|
||||
if __grains__['os'] == 'FreeBSD' and __grains__.get('osmajorrelease', 0) < 10:
|
||||
ret.append({
|
||||
'addr_family': 'inet',
|
||||
'destination': comps[0],
|
||||
'gateway': comps[1],
|
||||
'netmask': comps[2],
|
||||
'flags': comps[3],
|
||||
'interface': comps[5]})
|
||||
else:
|
||||
ret.append({
|
||||
'addr_family': 'inet',
|
||||
'destination': comps[0],
|
||||
'gateway': comps[1],
|
||||
'netmask': '',
|
||||
'flags': comps[2],
|
||||
'interface': comps[3]})
|
||||
cmd = 'netstat -f inet6 -rn | tail -n+5'
|
||||
out = __salt__['cmd.run'](cmd, python_shell=True)
|
||||
for line in out.splitlines():
|
||||
|
|
Loading…
Add table
Reference in a new issue