From 568e88435f74867da918bd0477acf6c9a039c2bc Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Wed, 8 Feb 2023 11:35:20 +1300 Subject: [PATCH] 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]https://opendev.org/openstack/tripleo-common/commit/60afc0eec44f698dd95d9d6ec80dad94a4b07329 Resolves: rhbz#2165527 Change-Id: Ib127b11cc26944dc4c348d7c8b6938bbea0a134a --- .../modules/tripleo_container_image_prepare.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/modules/tripleo_container_image_prepare.py b/tripleo_ansible/ansible_plugins/modules/tripleo_container_image_prepare.py index 7a58421ec..52bb15276 100644 --- a/tripleo_ansible/ansible_plugins/modules/tripleo_container_image_prepare.py +++ b/tripleo_ansible/ansible_plugins/modules/tripleo_container_image_prepare.py @@ -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: