From 1a90eb03052102a2e8d906262f97e7f3ff87fcdc Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Sat, 5 Aug 2023 16:57:54 +0100 Subject: [PATCH] Rename wsgi-rotation to wsgi-socket-rotation Commit 996f241 added support for new config option 'wsgi-rotation' but that name should have been 'wsgi-socket-rotation' in order to have a 1:1 relation with the apache config it changes. The following patches that implement this config are currently blocked until this lands so that they can be synced before merge: * https://review.opendev.org/c/openstack/charm-ceilometer/+/887793 * https://review.opendev.org/c/openstack/charm-cinder/+/886356 * https://review.opendev.org/c/openstack/charm-glance/+/886376 * https://review.opendev.org/c/openstack/charm-keystone/+/886377 * https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/885836 * https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/886373 Related-Bug: #2021550 --- charmhelpers/contrib/openstack/context.py | 8 ++++---- .../contrib/openstack/templates/wsgi-openstack-api.conf | 2 +- tests/contrib/openstack/test_os_contexts.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index 24a13d0d4..42f15032a 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -1748,9 +1748,9 @@ def __init__(self, name=None, script=None, admin_script=None, def __call__(self): total_processes = _calculate_workers() - enable_wsgi_rotation = config('wsgi-rotation') - if enable_wsgi_rotation is None: - enable_wsgi_rotation = True + enable_wsgi_socket_rotation = config('wsgi-socket-rotation') + if enable_wsgi_socket_rotation is None: + enable_wsgi_socket_rotation = True ctxt = { "service_name": self.service_name, "user": self.user, @@ -1764,7 +1764,7 @@ def __call__(self): "public_processes": int(math.ceil(self.public_process_weight * total_processes)), "threads": 1, - "wsgi_rotation": enable_wsgi_rotation, + "wsgi_socket_rotation": enable_wsgi_socket_rotation, } return ctxt diff --git a/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf b/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf index 2cb735e94..de5f603fc 100644 --- a/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf +++ b/charmhelpers/contrib/openstack/templates/wsgi-openstack-api.conf @@ -12,7 +12,7 @@ Listen {{ admin_port }} Listen {{ public_port }} {% endif -%} -{% if wsgi_rotation -%} +{% if wsgi_socket_rotation -%} WSGISocketRotation On {% else -%} WSGISocketRotation Off diff --git a/tests/contrib/openstack/test_os_contexts.py b/tests/contrib/openstack/test_os_contexts.py index ec84f5131..e9ae3adf7 100644 --- a/tests/contrib/openstack/test_os_contexts.py +++ b/tests/contrib/openstack/test_os_contexts.py @@ -3570,7 +3570,7 @@ def test_loglevel_context_unset(self): def test_wsgi_worker_config_context(self, _calculate_workers): self.config.side_effect = fake_config({ - 'worker-multiplier': 2, 'non-defined-wsgi-rotation': True + 'worker-multiplier': 2, 'non-defined-wsgi-socket-rotation': True }) _calculate_workers.return_value = 8 service_name = 'service-name' @@ -3588,7 +3588,7 @@ def test_wsgi_worker_config_context(self, "admin_processes": 2, "public_processes": 6, "threads": 1, - "wsgi_rotation": True, + "wsgi_socket_rotation": True, } self.assertEqual(expect, ctxt()) @@ -3596,7 +3596,7 @@ def test_wsgi_worker_config_context(self, def test_wsgi_worker_config_context_user_and_group(self, _calculate_workers): self.config.side_effect = fake_config({ - 'worker-multiplier': 1, 'wsgi-rotation': False + 'worker-multiplier': 1, 'wsgi-socket-rotation': False }) _calculate_workers.return_value = 1 service_name = 'service-name' @@ -3618,7 +3618,7 @@ def test_wsgi_worker_config_context_user_and_group(self, "admin_processes": 1, "public_processes": 1, "threads": 1, - "wsgi_rotation": False, + "wsgi_socket_rotation": False, } self.assertEqual(expect, ctxt())