[modules/nic] Add log for missing modules

When modules cannot be imported, add a warning line to the log.

see #367
This commit is contained in:
Tobias Witek 2019-03-01 15:13:34 +01:00
parent 930c70e06a
commit 8db3435ddc

View file

@ -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