Merge pull request #56 from cjlarose/master

Silence ImportErrors for optional dependencies
This commit is contained in:
tobi-wan-kenobi 2017-03-26 09:37:41 +02:00 committed by GitHub
commit 6ac6114b2e
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%) * cpu.critical: Critical threshold in % of CPU usage (defaults to 80%)
""" """
import psutil try:
import psutil
except ImportError:
pass
import bumblebee.input import bumblebee.input
import bumblebee.output import bumblebee.output
import bumblebee.engine import bumblebee.engine

View file

@ -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%)
""" """
import psutil try:
import psutil
except ImportError:
pass
import bumblebee.util import bumblebee.util
import bumblebee.input 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") * 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.util
import bumblebee.input import bumblebee.input

View file

@ -18,7 +18,10 @@ import bumblebee.output
import bumblebee.engine import bumblebee.engine
import json import json
import time import time
import requests try:
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):