mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 23:51:23 -07:00
avoid possible errors with new broadcast handling in linux
This commit is contained in:
parent
cb2cfaebda
commit
08e6c1d82b
1 changed files with 3 additions and 1 deletions
|
@ -1877,10 +1877,12 @@ class LinuxNetwork(Network):
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
words = line.split()
|
words = line.split()
|
||||||
|
broadcast = ''
|
||||||
if words[0] == 'inet':
|
if words[0] == 'inet':
|
||||||
if '/' in words[1]:
|
if '/' in words[1]:
|
||||||
address, netmask_length = words[1].split('/')
|
address, netmask_length = words[1].split('/')
|
||||||
broadcast = words[3]
|
if len(words) > 3:
|
||||||
|
broadcast = words[3]
|
||||||
else:
|
else:
|
||||||
# pointopoint interfaces do not have a prefix
|
# pointopoint interfaces do not have a prefix
|
||||||
address = words[1]
|
address = words[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue