Sync our version of the interprocess lock
The oslo version gained a exists function and merged in the commented code we had so we can go ahead and merge that into our source tree and remove the comment (since it's not useful anymore). The update is from lockutils.py, oslo incubator commit hash e3b52f20367e18. Change-Id: I858a4412d03c48c4ef1c2506edf6334c66ded3f0
This commit is contained in:

committed by
Joshua Harlow

parent
6f9448001c
commit
6542b99672
@@ -377,7 +377,6 @@ class _InterProcessLock(object):
|
||||
try:
|
||||
self.unlock()
|
||||
self.lockfile.close()
|
||||
# This is fixed in: https://review.openstack.org/70506
|
||||
LOG.debug('Released file lock "%s"', self.fname)
|
||||
except IOError:
|
||||
LOG.exception("Could not release the acquired lock `%s`",
|
||||
@@ -386,6 +385,9 @@ class _InterProcessLock(object):
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.release()
|
||||
|
||||
def exists(self):
|
||||
return os.path.exists(self.fname)
|
||||
|
||||
def trylock(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
Reference in New Issue
Block a user