summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Jochmaring <jjonas@mail.upb.de>2015-07-09 18:12:20 +0200
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-09-23 19:28:59 +0200
commitcf740e06f4131c8cff33727a5e98d5d3eb6f3e21 (patch)
treed3995c43c097d1f94f47988a0b929fd8cc9a4ae1
parentbda4daf4c2c5dad964c8f2e9c777fdea000d0731 (diff)
downloadbcfg2-cf740e06f4131c8cff33727a5e98d5d3eb6f3e21.tar.gz
bcfg2-cf740e06f4131c8cff33727a5e98d5d3eb6f3e21.tar.bz2
bcfg2-cf740e06f4131c8cff33727a5e98d5d3eb6f3e21.zip
fix check for reporting in src/lib/Bcfg2/Server/Plugins/Reporting.py
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Reporting.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Reporting.py b/src/lib/Bcfg2/Server/Plugins/Reporting.py
index 5c73546b4..b9dcdcc81 100644
--- a/src/lib/Bcfg2/Server/Plugins/Reporting.py
+++ b/src/lib/Bcfg2/Server/Plugins/Reporting.py
@@ -8,13 +8,17 @@ import Bcfg2.Options
from Bcfg2.Reporting.Transport.base import TransportError
from Bcfg2.Server.Plugin import Statistics, PullSource, Threaded, \
PluginInitError, PluginExecutionError
+import django
# required for reporting
-try:
- import south # pylint: disable=W0611
- HAS_SOUTH = True
-except ImportError:
- HAS_SOUTH = False
+if django.VERSION[0] == 1 and django.VERSION[1] >= 7:
+ HAS_REPORTING = True
+else:
+ try:
+ import south # pylint: disable=W0611
+ HAS_REPORTING = True
+ except ImportError:
+ HAS_REPORTING = False
def _rpc_call(method):
@@ -48,8 +52,8 @@ class Reporting(Statistics, Threaded, PullSource):
self.whoami = platform.node()
self.transport = None
- if not HAS_SOUTH:
- msg = "Django south is required for Reporting"
+ if not HAS_REPORTING:
+ msg = "Django 1.7+ or Django south is required for Reporting"
self.logger.error(msg)
raise PluginInitError(msg)