summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Reporting.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-09 10:04:37 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-09 10:04:37 -0400
commit623a06c4b9a1fa7040146ff27364fc64a5a6a57e (patch)
tree5834b3659ab688b2703b57f7856a35835ea5c671 /src/lib/Bcfg2/Server/Plugins/Reporting.py
parent375dc86e5cd6a859502e9f828b1977e7aae4138d (diff)
downloadbcfg2-623a06c4b9a1fa7040146ff27364fc64a5a6a57e.tar.gz
bcfg2-623a06c4b9a1fa7040146ff27364fc64a5a6a57e.tar.bz2
bcfg2-623a06c4b9a1fa7040146ff27364fc64a5a6a57e.zip
Reporting: made plugin produce errors if South is not installed
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Reporting.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Reporting.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Reporting.py b/src/lib/Bcfg2/Server/Plugins/Reporting.py
index f275bcc9d..1ea6637a8 100644
--- a/src/lib/Bcfg2/Server/Plugins/Reporting.py
+++ b/src/lib/Bcfg2/Server/Plugins/Reporting.py
@@ -11,6 +11,13 @@ from Bcfg2.Options import REPORTING_COMMON_OPTIONS
from Bcfg2.Server.Plugin import Statistics, PullSource, PluginInitError, \
PluginExecutionError
+# required for reporting
+try:
+ import south # pylint: disable=W0611
+ HAS_SOUTH = True
+except ImportError:
+ HAS_SOUTH = False
+
def _rpc_call(method):
""" Given the name of a Reporting Transport method, get a function
@@ -44,6 +51,11 @@ class Reporting(Statistics, PullSource): # pylint: disable=W0223
core.setup.update(REPORTING_COMMON_OPTIONS)
core.setup.reparse()
+ if not HAS_SOUTH:
+ msg = "Django south is required for Reporting"
+ self.logger.error(msg)
+ raise PluginInitError(msg)
+
try:
self.transport = load_transport_from_config(core.setup)
except TransportError: