From 6a055fffc889d6205d22c6e3bfb26516b8b24fdc Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Tue, 17 Dec 2024 15:57:26 +0200 Subject: [PATCH 1/2] excluded external ip if unavailable in CLI Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/ui/odf_topology.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocs_ci/ocs/ui/odf_topology.py b/ocs_ci/ocs/ui/odf_topology.py index 0e72819025a..4fadac335b0 100644 --- a/ocs_ci/ocs/ui/odf_topology.py +++ b/ocs_ci/ocs/ui/odf_topology.py @@ -139,6 +139,8 @@ def get_node_details_cli(node_name) -> dict: _address_dict = {item["type"]: item["address"] for item in _addresses} node_details["addresses"] = ( f"External IP: {_address_dict.get('ExternalIP')}; " + if _address_dict.get("ExternalIP") + else "" f"Hostname: {_address_dict.get('Hostname')}; " f"Internal IP: {_address_dict.get('InternalIP')}" ) From 3ec43379f5ba4a9014fda587aeb269e4ddf6483d Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Wed, 18 Dec 2024 14:20:17 +0200 Subject: [PATCH 2/2] remove internal dns from addresses Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/ui/page_objects/odf_topology_tab.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocs_ci/ocs/ui/page_objects/odf_topology_tab.py b/ocs_ci/ocs/ui/page_objects/odf_topology_tab.py index c163564300b..55287598834 100644 --- a/ocs_ci/ocs/ui/page_objects/odf_topology_tab.py +++ b/ocs_ci/ocs/ui/page_objects/odf_topology_tab.py @@ -1023,7 +1023,12 @@ def read_details(self) -> dict: for detail_name, loc in filtered_dict.items(): if detail_name == "details_sidebar_node_addresses": node_addresses = self.get_elements(loc) - addresses_txt = [el.text for el in node_addresses] + # exclude Internal DNS from addresses, it is applicable only for specific platforms + addresses_txt = [ + el.text + for el in node_addresses + if not el.text.startswith("Internal DNS") + ] addresses_txt = "; ".join(addresses_txt) details_dict[ detail_name.split("details_sidebar_node_", 1)[-1].strip()