diff options
author | PMR <pmr@pmr-lander> | 2019-11-12 15:22:42 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2019-11-12 15:22:42 +0000 |
commit | e2d5e078d60fc8b769e61871a26a3ca28d558841 (patch) | |
tree | f820a3e988c8893e943ca379f82376e9acc8dbd8 | |
parent | 235bda27445894cc427bd9ba7e28dd067ce70569 (diff) |
Import plainbox-provider-checkbox_0.50.0~rc2.orig.tar.gzupstream-0.50.0_rc2patched-0.50.0_rc2-1
-rwxr-xr-x | bin/network_device_info.py | 17 | ||||
-rwxr-xr-x | bin/wifi_nmcli_test.py | 2 | ||||
-rwxr-xr-x | manage.py | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/bin/network_device_info.py b/bin/network_device_info.py index 4a827de..925b3f5 100755 --- a/bin/network_device_info.py +++ b/bin/network_device_info.py @@ -49,11 +49,18 @@ class Utils(): @staticmethod def get_ipv4_address(interface): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - return socket.inet_ntoa(fcntl.ioctl( - s.fileno(), - 0x8915, # SIOCGIFADDR - struct.pack('256s', interface[:15].encode()) - )[20:24]) + try: + ipv4_addr = socket.inet_ntoa(fcntl.ioctl( + s.fileno(), + 0x8915, # SIOCGIFADDR + struct.pack('256s', interface[:15].encode()) + )[20:24]) + except Exception as e: + print("ERROR: getting the IPv4 address for %s: %s" % + (interface, repr(e))) + ipv4_addr = "***NOT CONFIGURED***" + finally: + return ipv4_addr @staticmethod def get_ipv6_address(interface): diff --git a/bin/wifi_nmcli_test.py b/bin/wifi_nmcli_test.py index 5e5cb6e..71f01c9 100755 --- a/bin/wifi_nmcli_test.py +++ b/bin/wifi_nmcli_test.py @@ -221,7 +221,7 @@ if __name__ == '__main__': if args.func: try: result = args.func(args) - except: + finally: cleanup_nm_connections() # The test is not required to run as root, but root access is required for @@ -5,7 +5,7 @@ from plainbox.provider_manager import N_ setup( name='plainbox-provider-checkbox', namespace='com.canonical.certification', - version="0.50.0rc1", + version="0.50.0rc2", description=N_("Checkbox provider"), gettext_domain='plainbox-provider-checkbox', strict=False, deprecated=False, |