Skip to content

Commit

Permalink
Charm-helpers sync
Browse files Browse the repository at this point in the history
Func-Test-Pr: openstack-charmers/zaza-openstack-tests#1139
Change-Id: Id06e0e004133a157c447af31f3cb308eefa722d1
  • Loading branch information
freyes committed Sep 27, 2023
1 parent fb1a1bb commit cf1ffe6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
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')
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
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: 6 additions & 2 deletions charmhelpers/contrib/storage/linux/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,19 @@ def get_osd_settings(relation_name):
return _order_dict_by_key(osd_settings)


def send_application_name(relid=None):
def send_application_name(relid=None, app_name=None):
"""Send the application name down the relation.
:param relid: Relation id to set application name in.
:type relid: str
:param app_name: Application name to send in the relation.
:type app_name: str
"""
if app_name is None:
app_name = application_name()
relation_set(
relation_id=relid,
relation_settings={'application-name': application_name()})
relation_settings={'application-name': app_name})


def send_osd_settings():
Expand Down
3 changes: 2 additions & 1 deletion charmhelpers/core/unitdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ def kv():

env_var = os.environ.get("CHARM_HELPERS_TESTMODE", "auto").lower()
if env_var not in ["auto", "no", "yes"]:
logging.warning(f"Unknown value for CHARM_HELPERS_TESTMODE '{env_var}', assuming 'no'")
logging.warning("Unknown value for CHARM_HELPERS_TESTMODE '%s'"
", assuming 'no'", env_var)
env_var = "no"

if env_var == "no":
Expand Down
2 changes: 1 addition & 1 deletion charmhelpers/fetch/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _snap_exec(commands):
:param commands: List commands
:return: Integer exit code
"""
assert type(commands) == list
assert isinstance(commands, list)

retry_count = 0
return_code = None
Expand Down

0 comments on commit cf1ffe6

Please sign in to comment.