Silence ImportErrors for optional dependencies. Fixes #55.
This commit is contained in:
parent
b20e83cb8a
commit
fe11bad826
4 changed files with 17 additions and 4 deletions
|
@ -7,7 +7,11 @@ Parameters:
|
||||||
* cpu.critical: Critical threshold in % of CPU usage (defaults to 80%)
|
* cpu.critical: Critical threshold in % of CPU usage (defaults to 80%)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
import psutil
|
import psutil
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
import bumblebee.output
|
import bumblebee.output
|
||||||
import bumblebee.engine
|
import bumblebee.engine
|
||||||
|
|
|
@ -7,7 +7,10 @@ Parameters:
|
||||||
* cpu.critical: Critical threshold in % of memory used (defaults to 90%)
|
* cpu.critical: Critical threshold in % of memory used (defaults to 90%)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
import psutil
|
import psutil
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
import bumblebee.util
|
import bumblebee.util
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
|
|
|
@ -6,7 +6,10 @@ Parameters:
|
||||||
* nic.exclude: Comma-separated list of interface prefixes to exclude (defaults to "lo,virbr,docker,vboxnet,veth")
|
* nic.exclude: Comma-separated list of interface prefixes to exclude (defaults to "lo,virbr,docker,vboxnet,veth")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
import netifaces
|
import netifaces
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
import bumblebee.util
|
import bumblebee.util
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
|
|
|
@ -18,7 +18,10 @@ import bumblebee.output
|
||||||
import bumblebee.engine
|
import bumblebee.engine
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
try:
|
||||||
import requests
|
import requests
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
class Module(bumblebee.engine.Module):
|
class Module(bumblebee.engine.Module):
|
||||||
def __init__(self, engine, config):
|
def __init__(self, engine, config):
|
||||||
|
|
Loading…
Reference in a new issue