Use default thread locking for container image prepare

Process based locking was added to improve container prepare
performance for python2/mistral, according to this change[1] so it
might not be appropriate to use it in an ansible module.

This change removes the ProcessLock so the image preparation uses the
default ThreadLock (and the thread executor).

It is possible that authentication caching doesn't work at all with
the process based executor, and support for that executor should be
removed entirely now that it is not required.

[1]60afc0eec4
Resolves: rhbz#2165527

Change-Id: Ib127b11cc26944dc4c348d7c8b6938bbea0a134a
This commit is contained in:
Steve Baker 2023-02-08 11:35:20 +13:00 committed by Sergii Golovatiuk
parent 9256ab0a86
commit 568e88435f
1 changed files with 2 additions and 6 deletions

View File

@ -27,7 +27,6 @@ from ansible_collections.openstack.cloud.plugins.module_utils.openstack import o
from tripleo_common import constants
from tripleo_common.image import image_uploader
from tripleo_common.image import kolla_builder
from tripleo_common.utils.locks import processlock
ANSIBLE_METADATA = {
'metadata_version': '1.1',
@ -144,10 +143,8 @@ def run_module():
roles_data = module.params.get('roles_data')
env = module.params.get('environment')
try:
lock = processlock.ProcessLock()
params = kolla_builder.container_images_prepare_multi(
env, roles_data, cleanup=cleanup, dry_run=dry_run,
lock=lock)
env, roles_data, cleanup=cleanup, dry_run=dry_run)
for role in roles_data:
# NOTE(tkajinam): If a role-specific container image prepare
@ -164,8 +161,7 @@ def run_module():
# parameters
params['%sParameters' % role['name']] = (
kolla_builder.container_images_prepare_multi(
tmp_env, [role], cleanup=cleanup, dry_run=dry_run,
lock=lock)
tmp_env, [role], cleanup=cleanup, dry_run=dry_run)
)
if not module.no_log: