summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-11-10 22:25:43 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-11-10 22:25:43 +0000
commitb8b2274dab46a91c59ab1f5153baf3516bc69757 (patch)
tree29e3b365d1852b960c49c551ce0548eec2d86637
parent681b0127f678f4c0f372c9e9fde519a5f343dc7a (diff)
downloadbcfg2-b8b2274dab46a91c59ab1f5153baf3516bc69757.tar.gz
bcfg2-b8b2274dab46a91c59ab1f5153baf3516bc69757.tar.bz2
bcfg2-b8b2274dab46a91c59ab1f5153baf3516bc69757.zip
Reports: Fix incorrect error message (reported by Thorsten Lockert) [bugfix]
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5567 ce84e21b-d406-0410-9b95-82705330c041
-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)