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: I194bbe253e1e703957ec9e862fc94f1a69f58fe8
Signed-off-by: Rahul Kumar <rahul.k4@tataelxsi.co.in>
diff --git a/NG-RO/osm_ng_ro/monitor.py b/NG-RO/osm_ng_ro/monitor.py
index 529ce0e..a7f41a1 100644
--- a/NG-RO/osm_ng_ro/monitor.py
+++ b/NG-RO/osm_ng_ro/monitor.py
@@ -625,9 +625,17 @@
] = 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:
diff --git a/releasenotes/notes/bug_fix_2306_Monitoring_task_in_RO_monitoring.py_is_replacing_the_dual_stcak_IP_with_IPV4-d18276e037a118a7.yaml b/releasenotes/notes/bug_fix_2306_Monitoring_task_in_RO_monitoring.py_is_replacing_the_dual_stcak_IP_with_IPV4-d18276e037a118a7.yaml
new file mode 100644
index 0000000..20ee4ba
--- /dev/null
+++ b/releasenotes/notes/bug_fix_2306_Monitoring_task_in_RO_monitoring.py_is_replacing_the_dual_stcak_IP_with_IPV4-d18276e037a118a7.yaml
@@ -0,0 +1,81 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+prelude: >
+ Replace this text with content to appear at the top of the section for this
+ release. All of the prelude content is merged together and then rendered
+ separately from the items listed in other parts of the file, so the text
+ needs to be worded so that both the prelude and the other items make sense
+ when read independently. This may mean repeating some details. Not every
+ release note requires a prelude. Usually only notes describing major
+ features or adding release theme details should have a prelude.
+features:
+ - |
+ List new features here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+issues:
+ - |
+ List known issues here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+upgrade:
+ - |
+ List upgrade notes here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+deprecations:
+ - |
+ List deprecations notes here, or remove this section. All of the list
+ items in this section are combined when the release notes are rendered, so
+ the text needs to be worded so that it does not depend on any information
+ only available in another section, such as the prelude. This may mean
+ repeating some details.
+critical:
+ - |
+ Add critical notes here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+security:
+ - |
+ Add security notes here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+fixes:
+ - |
+ Add normal bug fixes here, or remove this section. All of the list items
+ in this section are combined when the release notes are rendered, so the
+ text needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.
+other:
+ - |
+ Add other notes here, or remove this section. All of the list items in
+ this section are combined when the release notes are rendered, so the text
+ needs to be worded so that it does not depend on any information only
+ available in another section, such as the prelude. This may mean repeating
+ some details.