diff options
Diffstat (limited to 'oslo_concurrency/lockutils.py')
-rw-r--r-- | oslo_concurrency/lockutils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py index 7fe049b..3236289 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 @@ -200,9 +201,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): |