summaryrefslogtreecommitdiff
path: root/oslo_concurrency/lockutils.py
diff options
context:
space:
mode:
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):