From 6542b99672310f7d339b13208dbf7befae5fd75a Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sun, 8 Jun 2014 23:37:50 -0700 Subject: [PATCH] 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 --- taskflow/utils/lock_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taskflow/utils/lock_utils.py b/taskflow/utils/lock_utils.py index 942e27bb..1b4c9008 100644 --- a/taskflow/utils/lock_utils.py +++ b/taskflow/utils/lock_utils.py @@ -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()