Silence ImportErrors for optional dependencies. Fixes #55.

This commit is contained in:
Chris LaRose 2017-03-25 18:32:11 -07:00
parent b20e83cb8a
commit fe11bad826
4 changed files with 17 additions and 4 deletions

View file

@ -7,7 +7,11 @@ Parameters:
* cpu.critical: Critical threshold in % of CPU usage (defaults to 80%)
"""
import psutil
try:
import psutil
except ImportError:
pass
import bumblebee.input
import bumblebee.output
import bumblebee.engine

View file

@ -7,7 +7,10 @@ Parameters:
* cpu.critical: Critical threshold in % of memory used (defaults to 90%)
"""
import psutil
try:
import psutil
except ImportError:
pass
import bumblebee.util
import bumblebee.input

View file

@ -6,7 +6,10 @@ Parameters:
* nic.exclude: Comma-separated list of interface prefixes to exclude (defaults to "lo,virbr,docker,vboxnet,veth")
"""
import netifaces
try:
import netifaces
except ImportError:
pass
import bumblebee.util
import bumblebee.input

View file

@ -18,7 +18,10 @@ import bumblebee.output
import bumblebee.engine
import json
import time
import requests
try:
import requests
except ImportError:
pass
class Module(bumblebee.engine.Module):
def __init__(self, engine, config):