1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

avoid possible errors with new broadcast handling in linux

This commit is contained in:
Brian Coca 2015-08-06 09:00:52 -04:00
parent cb2cfaebda
commit 08e6c1d82b

View file

@ -1877,10 +1877,12 @@ class LinuxNetwork(Network):
if not line:
continue
words = line.split()
broadcast = ''
if words[0] == 'inet':
if '/' in words[1]:
address, netmask_length = words[1].split('/')
broadcast = words[3]
if len(words) > 3:
broadcast = words[3]
else:
# pointopoint interfaces do not have a prefix
address = words[1]