From 24fe76357ea8edb21dd8a124627f18a12657bd11 Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Mon, 24 Dec 2007 22:56:24 +0000 Subject: 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 --- src/sbin/bcfg2-admin | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-admin') 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" -- cgit v1.2.3-1-g7c22