From e0215d6fc3455e1c84303b03a665277de216b149 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 23 Jul 2009 01:31:45 +0000 Subject: bcfg2: handle errors in lockfile unlocking git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5377 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sbin') 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 -- cgit v1.2.3-1-g7c22