diff options
-rw-r--r-- | machammer/network.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/machammer/network.py b/machammer/network.py index 17608ce..5f5fb87 100644 --- a/machammer/network.py +++ b/machammer/network.py @@ -32,7 +32,11 @@ def get_wifi_power(): def is_wired(primary=False): """Do we have an "active" Ethernet connection?""" for p in get_ports('Ethernet'): - r = check_output('/sbin/ifconfig', p['interface']) + try: + r = check_output('/sbin/ifconfig', p['interface']) + except Exception as e: + raise Exception('Failed to get interface status: %s' % e) + active = 'status: active' in r return get_primary(p['interface']) if primary else active |