[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:
parent
930c70e06a
commit
8db3435ddc
1 changed files with 5 additions and 2 deletions
|
@ -11,11 +11,14 @@ Parameters:
|
||||||
* nic.format: Format string (defaults to "{intf} {state} {ip} {ssid}")
|
* nic.format: Format string (defaults to "{intf} {state} {ip} {ssid}")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import netifaces
|
import netifaces
|
||||||
import subprocess
|
import subprocess
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
pass
|
log.warning("failed to import nic: {}".format(e))
|
||||||
|
|
||||||
import bumblebee.util
|
import bumblebee.util
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
|
|
Loading…
Reference in a new issue