From 8db3435ddcd757c00995668b6f1130f43719a36a Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Fri, 1 Mar 2019 15:13:34 +0100 Subject: [PATCH] [modules/nic] Add log for missing modules When modules cannot be imported, add a warning line to the log. see #367 --- bumblebee/modules/nic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/nic.py b/bumblebee/modules/nic.py index a43591b..1e37e2b 100644 --- a/bumblebee/modules/nic.py +++ b/bumblebee/modules/nic.py @@ -11,11 +11,14 @@ Parameters: * nic.format: Format string (defaults to "{intf} {state} {ip} {ssid}") """ +import logging +log = logging.getLogger(__name__) + try: import netifaces import subprocess -except ImportError: - pass +except ImportError as e: + log.warning("failed to import nic: {}".format(e)) import bumblebee.util import bumblebee.input