publicip - Bug Fix - IP address changes wer being missed if an interface was present but did not have an IPv4 address associated with it. Added exception handling to mitigate this.

This commit is contained in:
tfwiii 2022-10-12 13:52:55 +07:00
parent 1682a47554
commit 697c3310a0

View file

@ -72,8 +72,10 @@ class Module(core.module.Module):
# Look for any changes to IP addresses # Look for any changes to IP addresses
try: try:
for interface in netifaces.interfaces(): for interface in netifaces.interfaces():
try:
__current_ips.add(netifaces.ifaddresses(interface)[2][0]['addr']) __current_ips.add(netifaces.ifaddresses(interface)[2][0]['addr'])
except:
pass
except: except:
# If not ip address information found clear __current_ips # If not ip address information found clear __current_ips
__current_ips.clear() __current_ips.clear()