Merge pull request #1 from obeone/netifaces2

- global packages update
This commit is contained in:
tze089 2024-01-16 12:53:12 +01:00 committed by GitHub
commit 54cdbc8893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View file

@ -81,7 +81,7 @@ class Network(object):
#
for addr in ip6_addr:
addr["addr"] = addr["addr"].replace('%{}'.format(interface), '')
addr["netmask"] = addr["netmask"].split('/')[0]
addr["mask"] = addr["mask"].split('/')[0]
ip_addr.append(addr)
mac = open('/sys/class/net/{}/address'.format(interface), 'r').read().strip()
@ -109,7 +109,7 @@ class Network(object):
'ip': [
'{}/{}'.format(
x['addr'],
IPAddress(x['netmask']).netmask_bits()
IPAddress(x['mask']).netmask_bits()
) for x in ip_addr
] if ip_addr else None, # FIXME: handle IPv6 addresses
'ethtool': Ethtool(interface).parse(),