summaryrefslogtreecommitdiff
path: root/oslo_concurrency/lockutils.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-06-08 17:05:16 +0000
committerGerrit Code Review <review@openstack.org>2020-06-08 17:05:16 +0000
commit80a6e1d489c5d650ea1ce47f4d81bd98bc803542 (patch)
treedd119a651ff71071d07a6f5f2418c0a467c4f314 /oslo_concurrency/lockutils.py
parent174b29162d239bc3e9d74e689e9de7db01b3396c (diff)
parente57a1c829df3f77d2c3a9c2712f1decef6284500 (diff)
downloadoslo-concurrency-80a6e1d489c5d650ea1ce47f4d81bd98bc803542.tar.gz
Merge "Don't warn on lock removal if file doesn't exist"
Diffstat (limited to 'oslo_concurrency/lockutils.py')
-rw-r--r--oslo_concurrency/lockutils.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py
index e5798c5..67cf41e 100644
--- a/oslo_concurrency/lockutils.py
+++ b/oslo_concurrency/lockutils.py
@@ -14,6 +14,7 @@
# under the License.
import contextlib
+import errno
import functools
import logging
import os
@@ -199,9 +200,10 @@ def remove_external_lock_file(name, lock_file_prefix=None, lock_path=None,
lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
try:
os.remove(lock_file_path)
- except OSError:
- LOG.info('Failed to remove file %(file)s',
- {'file': lock_file_path})
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ LOG.warning('Failed to remove file %(file)s',
+ {'file': lock_file_path})
def internal_lock(name, semaphores=None):