diff --git a/ironic/common/dhcp_factory.py b/ironic/common/dhcp_factory.py index 306c937a63..aaff635df3 100644 --- a/ironic/common/dhcp_factory.py +++ b/ironic/common/dhcp_factory.py @@ -37,7 +37,7 @@ class DHCPFactory(object): # NOTE(lucasagomes): Use lockutils to avoid a potential race in eventlet # that might try to create two dhcp factories. @classmethod - @lockutils.synchronized(EM_SEMAPHORE, 'ironic-') + @lockutils.synchronized(EM_SEMAPHORE) def _set_dhcp_provider(cls, **kwargs): """Initialize the dhcp provider diff --git a/ironic/common/driver_factory.py b/ironic/common/driver_factory.py index a62741f73e..90040b7d85 100644 --- a/ironic/common/driver_factory.py +++ b/ironic/common/driver_factory.py @@ -135,7 +135,7 @@ class BaseDriverFactory(object): # NOTE(deva): Use lockutils to avoid a potential race in eventlet # that might try to create two driver factories. @classmethod - @lockutils.synchronized(EM_SEMAPHORE, 'ironic-') + @lockutils.synchronized(EM_SEMAPHORE) def _init_extension_manager(cls): # NOTE(deva): In case multiple greenthreads queue up on this lock # before _extension_manager is initialized, prevent diff --git a/ironic/common/policy.py b/ironic/common/policy.py index 79119736d3..fb73be2724 100644 --- a/ironic/common/policy.py +++ b/ironic/common/policy.py @@ -205,7 +205,7 @@ def list_policies(): return policies -@lockutils.synchronized('policy_enforcer', 'ironic-') +@lockutils.synchronized('policy_enforcer') def init_enforcer(policy_file=None, rules=None, default_rule=None, use_conf=True): """Synchronously initializes the policy enforcer diff --git a/ironic/drivers/modules/image_cache.py b/ironic/drivers/modules/image_cache.py index e270b4e454..11702a5b73 100644 --- a/ironic/drivers/modules/image_cache.py +++ b/ironic/drivers/modules/image_cache.py @@ -82,7 +82,7 @@ class ImageCache(object): if self.master_dir is None: # NOTE(ghe): We don't share images between instances/hosts if not CONF.parallel_image_downloads: - with lockutils.lock(img_download_lock_name, 'ironic-'): + with lockutils.lock(img_download_lock_name): _fetch(ctx, href, dest_path, force_raw) else: _fetch(ctx, href, dest_path, force_raw) @@ -106,7 +106,7 @@ class ImageCache(object): img_download_lock_name = 'download-image:%s' % master_file_name # TODO(dtantsur): lock expiration time - with lockutils.lock(img_download_lock_name, 'ironic-'): + with lockutils.lock(img_download_lock_name): # NOTE(vdrok): After rebuild requested image can change, so we # should ensure that dest_path and master_path (if exists) are # pointing to the same file and their content is up to date @@ -123,7 +123,7 @@ class ImageCache(object): if cache_up_to_date: # NOTE(dtantsur): ensure we're not in the middle of clean up - with lockutils.lock('master_image', 'ironic-'): + with lockutils.lock('master_image'): os.link(master_path, dest_path) LOG.debug("Master cache hit for image %(href)s", {'href': href}) @@ -165,7 +165,7 @@ class ImageCache(object): finally: utils.rmtree_without_raise(tmp_dir) - @lockutils.synchronized('master_image', 'ironic-') + @lockutils.synchronized('master_image') def clean_up(self, amount=None): """Clean up directory with images, keeping cache of the latest images. diff --git a/ironic/nova/compute/manager.py b/ironic/nova/compute/manager.py index 59782d7bdb..dea36c20f6 100644 --- a/ironic/nova/compute/manager.py +++ b/ironic/nova/compute/manager.py @@ -97,7 +97,7 @@ class ClusteredComputeManager(manager.ComputeManager): except Exception: pass - @lockutils.synchronized(CCM_SEMAPHORE, 'ironic-') + @lockutils.synchronized(CCM_SEMAPHORE) def _update_resources(self, node_uuid): """Update the specified node resource