[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}")
|
||||
"""
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue