summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Server/Reports/settings.py5
-rwxr-xr-xsrc/sbin/bcfg2-reports11
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py
index 93c77b387..712d597f6 100644
--- a/src/lib/Server/Reports/settings.py
+++ b/src/lib/Server/Reports/settings.py
@@ -95,7 +95,10 @@ AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',
# The NIS group authorized to login to BCFG2's reportinvg system
AUTHORIZED_GROUP = ''
#create login url area:
-import django.contrib.auth
+try:
+ import django.contrib.auth
+except ImportError:
+ print('Import of Django module failed. Is Django installed?')
django.contrib.auth.LOGIN_URL = '/login'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports
index cc5f89aa9..35c72f9d7 100755
--- a/src/sbin/bcfg2-reports
+++ b/src/sbin/bcfg2-reports
@@ -2,13 +2,10 @@
'''Query reporting system for client status'''
__revision__ = '$Revision$'
-import os, sys
-try:
- import Bcfg2.Server.Reports.settings
-except:
- sys.stderr.write("Failed to load configuration settings."
- "is /etc/bcfg2.conf readable?")
- sys.exit(1)
+import os
+import sys
+
+import Bcfg2.Server.Reports.settings
project_directory = os.path.dirname(Bcfg2.Server.Reports.settings.__file__)
project_name = os.path.basename(project_directory)