From 0ec568d35473c9c89d28318fe511a08ca36d4e3f Mon Sep 17 00:00:00 2001 From: rahulkumarr Date: Mon, 17 Jun 2024 15:50:30 +0530 Subject: [PATCH] Fix Bug 2306: Monitoring task in RO defined in RO/monitoring.py is replacing the dual-stcak [IPV4, IPV6] with IPV4 in Vnfrs collection Change-Id: Ie6395ed4b8499943ebbd57dd1c7aeed2433ae92c Signed-off-by: rahulkumarr --- NG-RO/osm_ng_ro/monitor.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/NG-RO/osm_ng_ro/monitor.py b/NG-RO/osm_ng_ro/monitor.py index ebb27799..34af39ec 100644 --- a/NG-RO/osm_ng_ro/monitor.py +++ b/NG-RO/osm_ng_ro/monitor.py @@ -624,10 +624,18 @@ class MonitorVms: interface_info.get("mac_address") ) + @staticmethod + def _get_dual_ip(data=None): + if data: + ip_addresses = [item["ip_address"] for item in data] + return ";".join(ip_addresses) if len(ip_addresses) > 1 else ip_addresses[0] + else: + return None + @staticmethod def _get_current_ip_address(interface_info: dict) -> Optional[str]: if interface_info.get("fixed_ips") and interface_info["fixed_ips"][0]: - return interface_info["fixed_ips"][0].get("ip_address") + return MonitorVms._get_dual_ip(interface_info.get("fixed_ips")) @staticmethod def backup_vdu_interfaces(vdur_vim_info_update: dict) -> None: -- 2.25.1