X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fmonitor.py;h=34af39ec601d5c8b9d8287e5d8c5f8453ca395ca;hb=refs%2Fchanges%2F27%2F14427%2F1;hp=ebb277992fc9a633d2574c48a248dd50171848bf;hpb=aca8cb5e63ebd11cc69373323d8df62b5d8cbfe2;p=osm%2FRO.git 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: