summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-10-10 01:59:47 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-10-10 01:59:47 +0000
commit529c735d90b106f8357d5994b6dad57bc3102699 (patch)
tree7a66b7ee89d7cbec0a83dcb015a7786abb8bea56
parent88b0cd44b7b311b17cbb2576882b73180cdc071d (diff)
downloadbcfg2-529c735d90b106f8357d5994b6dad57bc3102699.tar.gz
bcfg2-529c735d90b106f8357d5994b6dad57bc3102699.tar.bz2
bcfg2-529c735d90b106f8357d5994b6dad57bc3102699.zip
fix the rest of lockfile bypassing
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4939 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-xsrc/sbin/bcfg26
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index b2d203a1a..bd05b3a53 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -316,14 +316,16 @@ class Client:
self.fatal_error("An other instance of bcfg2 is running. If you what to bypass the check, run with %s option" %
(Bcfg2.Options.OMIT_LOCK_CHECK.cmd))
except:
+ lockfile = None
self.logger.error("Failed to open lockfile")
# execute the said configuration
self.tools.Execute()
if not self.setup['omit-lock-check']:
#unlock here
- fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
- os.remove(LOCKFILE)
+ if lockfile:
+ fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
+ os.remove(LOCKFILE)
if not self.setup['file']:
# upload statistics