summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gogolok <gogo@cs.uni-sb.de>2007-12-24 22:56:24 +0000
committerRobert Gogolok <gogo@cs.uni-sb.de>2007-12-24 22:56:24 +0000
commit24fe76357ea8edb21dd8a124627f18a12657bd11 (patch)
treefb9eafe4b28198f6d780c5f89a91ae1456c3ad88
parent663cd074bf08a0f3d2bee0c5351ba33e8a9b80a3 (diff)
downloadbcfg2-24fe76357ea8edb21dd8a124627f18a12657bd11.tar.gz
bcfg2-24fe76357ea8edb21dd8a124627f18a12657bd11.tar.bz2
bcfg2-24fe76357ea8edb21dd8a124627f18a12657bd11.zip
don't crash if no permission to write config file
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4109 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-xsrc/sbin/bcfg2-admin5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin
index 94e9cc153..bd70873e7 100755
--- a/src/sbin/bcfg2-admin
+++ b/src/sbin/bcfg2-admin
@@ -118,7 +118,10 @@ def initialize_repo(cfile):
#guess path of ssl key file
keypath = os.path.dirname(os.path.abspath(cfile))
- open(cfile,"w").write(config % ( repo, password, keypath, uri ))
+ try:
+ open(cfile,"w").write(config % ( repo, password, keypath, uri ))
+ except:
+ err_exit("Failed to write bcfg2 config file to %s" % cfile)
#generate the ssl key
print "Now we will generate the ssl key used for secure communitcation"