From 4829d0c5e4d61fdf4a4bdd8592afca787ea036d6 Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Sun, 22 Dec 2024 10:11:55 +0200 Subject: [PATCH] [ROSA HCP] exclude external dns if unavailable in CLI (#11057) Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/ui/odf_topology.py | 2 ++ ocs_ci/ocs/ui/page_objects/odf_topology_tab.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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')}" ) 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()