Fix fbsd netstat route on fbsd 10+

This commit is contained in:
Kevin Bowling 2016-08-09 16:30:30 -07:00
parent 244c3bd495
commit 0d49dd3c29

View file

@ -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():