diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-07-23 01:31:45 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-07-23 01:31:45 +0000 |
commit | e0215d6fc3455e1c84303b03a665277de216b149 (patch) | |
tree | 68711bedc777666093654d61525706e5033bd8ec /src | |
parent | 9f08a4f032e05382f7f10061ccff42963020f811 (diff) | |
download | bcfg2-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-x | src/sbin/bcfg2 | 7 |
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 |