summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Reports/importscript.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-03-09 16:28:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-03-09 16:28:31 +0000
commit721c80c052afc40cb4dac5fb2ee52435129e2c6f (patch)
treebf1b2f248729024cee871b72e354c0906df55d32 /src/lib/Server/Reports/importscript.py
parent7e710d354643c34d585415d67136c6513519adf7 (diff)
downloadbcfg2-721c80c052afc40cb4dac5fb2ee52435129e2c6f.tar.gz
bcfg2-721c80c052afc40cb4dac5fb2ee52435129e2c6f.tar.bz2
bcfg2-721c80c052afc40cb4dac5fb2ee52435129e2c6f.zip
Improve importscript error message when bcfg2.conf is not readable (Resolves Ticket #527) [bugfix]
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4411 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Reports/importscript.py')
-rwxr-xr-xsrc/lib/Server/Reports/importscript.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/Server/Reports/importscript.py b/src/lib/Server/Reports/importscript.py
index 1a4ccea23..34e6eef82 100755
--- a/src/lib/Server/Reports/importscript.py
+++ b/src/lib/Server/Reports/importscript.py
@@ -4,13 +4,10 @@ __revision__ = '$Revision$'
import os, sys, binascii
try:
- import settings
-except ImportError:
- try:
- import Bcfg2.Server.Reports.settings
- except ImportError:
- sys.stderr.write("Failed to locate settings.py. Is Bcfg2.Server.Reports python module installed?")
- sys.exit(1)
+ import Bcfg2.Server.Reports.settings
+except:
+ sys.stderr.write("Failed to load configuration settings. is /etc/bcfg2.conf readable?")
+ sys.exit(1)
project_directory = os.path.dirname(settings.__file__)
project_name = os.path.basename(project_directory)