Updated whataremyips -> added try/catch block to prevent error related to known
netifaces issue: https://bugs.launchpad.net/ubuntu/+source/netifaces/+bug/753009 Change-Id: I0f4ccdcf6d1655923d39ed44f4eb81203d3e525b
This commit is contained in:
parent
0a7f8ca7b1
commit
76afb46d91
@ -566,12 +566,15 @@ def whataremyips():
|
||||
"""
|
||||
addresses = []
|
||||
for interface in netifaces.interfaces():
|
||||
try:
|
||||
iface_data = netifaces.ifaddresses(interface)
|
||||
for family in iface_data:
|
||||
if family not in (netifaces.AF_INET, netifaces.AF_INET6):
|
||||
continue
|
||||
for address in iface_data[family]:
|
||||
addresses.append(address['addr'])
|
||||
except ValueError:
|
||||
pass
|
||||
return addresses
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user