mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 19:20:22 -07:00
Updated GenericBsdIfconfigNetwork to collect gateway
This commit is contained in:
parent
714cb02f5b
commit
1c247c9eb4
1 changed files with 6 additions and 3 deletions
|
@ -1548,9 +1548,12 @@ class GenericBsdIfconfigNetwork(Network):
|
||||||
lines = out.split('\n')
|
lines = out.split('\n')
|
||||||
for line in lines:
|
for line in lines:
|
||||||
words = line.split()
|
words = line.split()
|
||||||
# look for first word starting interface
|
# Collect output from route command
|
||||||
if len(words) > 0 and words[0] == 'interface:':
|
if len(words) > 0:
|
||||||
|
if words[0] == 'interface:':
|
||||||
interface[v]['interface'] = words[1]
|
interface[v]['interface'] = words[1]
|
||||||
|
if words[0] == 'gateway:':
|
||||||
|
interface[v]['gateway'] = words[1]
|
||||||
|
|
||||||
return interface['v4'], interface['v6']
|
return interface['v4'], interface['v6']
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue