diff --git a/tripleo_common/image/image_uploader.py b/tripleo_common/image/image_uploader.py index f76958c40..917631731 100644 --- a/tripleo_common/image/image_uploader.py +++ b/tripleo_common/image/image_uploader.py @@ -1152,7 +1152,7 @@ class PythonImageUploader(BaseImageUploader): LOG.debug('Starting acquire for lock %s' % layer) with lock.get_lock(): LOG.debug('Acquired for unlock %s' % layer) - if layer in lock.objects(): + while layer in lock.objects(): lock.objects().remove(layer) LOG.debug('Updated lock info %s' % layer) LOG.debug('Released lock on layer %s' % layer) diff --git a/tripleo_common/utils/locks/threadinglock.py b/tripleo_common/utils/locks/threadinglock.py index 14f582f3f..5e47edc97 100644 --- a/tripleo_common/utils/locks/threadinglock.py +++ b/tripleo_common/utils/locks/threadinglock.py @@ -19,4 +19,4 @@ import threading class ThreadingLock(base.BaseLock): def __init__(self): self._lock = threading.Lock() - self._objects = set() + self._objects = []