summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/image_cache.py
diff options
context:
space:
mode:
authorYuriy Zveryanskyy <yzveryanskyy@mirantis.com>2016-10-07 15:29:49 +0300
committerYuriy Zveryanskyy <yzveryanskyy@mirantis.com>2016-11-28 13:29:01 +0200
commitae73b8e83ef124dd0fa132e0f4a454102b66134f (patch)
tree77a3591b7bfc321d4a255b4792079925415219dc /ironic/drivers/modules/image_cache.py
parent24bc4cbd7a4a6de46be56e07fa1aafabc5abf911 (diff)
downloadironic-ae73b8e83ef124dd0fa132e0f4a454102b66134f.tar.gz
Remove file prefix parameter from lockutils methods
"lock_file_prefix" parameter is only needed for external locks (is not default), and external locks are not needed for ironic currently. Change-Id: I685b2f464f9d7dbacf5a8f86a1872e269fb097e9
Diffstat (limited to 'ironic/drivers/modules/image_cache.py')
-rw-r--r--ironic/drivers/modules/image_cache.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ironic/drivers/modules/image_cache.py b/ironic/drivers/modules/image_cache.py
index e270b4e45..11702a5b7 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.