Fixes endpoint discovery

The zaza test used the default endpoint as exposed by
the unit to perform object IO, however, SSL is configured
for PUBLIC,INTERNAL, and ADMIN bindings.

Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
This commit is contained in:
Utkarsh Bhatt
2024-06-12 18:35:00 +05:30
parent b0d0012a95
commit 21b51a467f
+5 -6
View File
@@ -840,13 +840,12 @@ class CephRGWTest(test_utils.BaseCharmTest):
:param unit_name: Unit name for which RGW endpoint is required.
:type unit_name: str
"""
unit = zaza_model.get_unit_from_name(unit_name)
unit_address = zaza_model.get_unit_public_address(
unit,
self.model_name
)
# Get address "public" network binding.
unit_address = zaza_model.run_on_unit(
unit_name, "network-get public --bind-address"
).get('Stdout', '').strip()
logging.debug("Unit: {}, Endpoint: {}".format(unit_name, unit_address))
logging.info("Unit: {}, Endpoint: {}".format(unit_name, unit_address))
if unit_address is None:
return None
# Evaluate port