Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename wsgi-rotation to wsgi-socket-rotation #833

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions charmhelpers/contrib/openstack/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a potentially breaking change, albeit only on master branch charms. Please could you link to the bug or gerrit reviews where this will be consumed? Thanks.

if enable_wsgi_socket_rotation is None:
enable_wsgi_socket_rotation = True
ctxt = {
"service_name": self.service_name,
"user": self.user,
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Listen {{ admin_port }}
Listen {{ public_port }}
{% endif -%}

{% if wsgi_rotation -%}
{% if wsgi_socket_rotation -%}
WSGISocketRotation On
{% else -%}
WSGISocketRotation Off
Expand Down
8 changes: 4 additions & 4 deletions tests/contrib/openstack/test_os_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -3588,15 +3588,15 @@ 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())

@patch.object(context, '_calculate_workers')
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'
Expand All @@ -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())

Expand Down
Loading