diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-09-16 19:06:59 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-09-23 19:28:59 +0200 |
commit | 2d10367098b1e7424a48de670c6a936f2b4dbb0f (patch) | |
tree | 7d0ccb41d661ba1d4a0cc7ecc4143b3ee15b17e1 /src/lib/Bcfg2/Server | |
parent | cf740e06f4131c8cff33727a5e98d5d3eb6f3e21 (diff) | |
download | bcfg2-2d10367098b1e7424a48de670c6a936f2b4dbb0f.tar.gz bcfg2-2d10367098b1e7424a48de670c6a936f2b4dbb0f.tar.bz2 bcfg2-2d10367098b1e7424a48de670c6a936f2b4dbb0f.zip |
Reporting: Clear error message if django is missing
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Reporting.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Reporting.py b/src/lib/Bcfg2/Server/Plugins/Reporting.py index b9dcdcc81..e372006c7 100644 --- a/src/lib/Bcfg2/Server/Plugins/Reporting.py +++ b/src/lib/Bcfg2/Server/Plugins/Reporting.py @@ -8,17 +8,16 @@ 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 -if django.VERSION[0] == 1 and django.VERSION[1] >= 7: - HAS_REPORTING = True -else: - try: +try: + import django + if django.VERSION[0] == 1 and django.VERSION[1] >= 7: + HAS_REPORTING = True + else: import south # pylint: disable=W0611 HAS_REPORTING = True - except ImportError: - HAS_REPORTING = False +except ImportError: + HAS_REPORTING = False def _rpc_call(method): |