summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-07-23 01:31:45 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-07-23 01:31:45 +0000
commite0215d6fc3455e1c84303b03a665277de216b149 (patch)
tree68711bedc777666093654d61525706e5033bd8ec /src
parent9f08a4f032e05382f7f10061ccff42963020f811 (diff)
downloadbcfg2-e0215d6fc3455e1c84303b03a665277de216b149.tar.gz
bcfg2-e0215d6fc3455e1c84303b03a665277de216b149.tar.bz2
bcfg2-e0215d6fc3455e1c84303b03a665277de216b149.zip
bcfg2: handle errors in lockfile unlocking
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5377 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg27
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index 0e5db5161..bbdbba68d 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -275,8 +275,11 @@ class Client:
if not self.setup['omit-lock-check']:
#unlock here
if lockfile:
- fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
- os.remove(LOCKFILE)
+ try:
+ fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)
+ os.remove(LOCKFILE)
+ except OSError:
+ self.logger.error("Failed to unlock lockfile %s" % lockfile.name)
if not self.setup['file']:
# upload statistics