From 697c3310a0b8be0866710d59dca434a9a437d2e0 Mon Sep 17 00:00:00 2001 From: tfwiii Date: Wed, 12 Oct 2022 13:52:55 +0700 Subject: [PATCH] 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. --- bumblebee_status/modules/contrib/publicip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee_status/modules/contrib/publicip.py b/bumblebee_status/modules/contrib/publicip.py index 9a8f468..8ae10a0 100644 --- a/bumblebee_status/modules/contrib/publicip.py +++ b/bumblebee_status/modules/contrib/publicip.py @@ -72,8 +72,10 @@ class Module(core.module.Module): # Look for any changes to IP addresses try: for interface in netifaces.interfaces(): - __current_ips.add(netifaces.ifaddresses(interface)[2][0]['addr']) - + try: + __current_ips.add(netifaces.ifaddresses(interface)[2][0]['addr']) + except: + pass except: # If not ip address information found clear __current_ips __current_ips.clear()