bugfix(ip/mac): increments only in extra VDU, not the first one. Bug 1578 54/11054/3
authorbravof <fbravo@whitestack.com>
Thu, 1 Jul 2021 13:32:30 +0000 (09:32 -0400)
committerbravof <fbravo@whitestack.com>
Thu, 1 Jul 2021 15:27:08 +0000 (11:27 -0400)
Change-Id: I21a0c2e15934e58d22a3a373a6ea6ef68c9b6ebf
Signed-off-by: bravof <fbravo@whitestack.com>
osm_nbi/instance_topics.py

index ebef36e..d76b0b1 100644 (file)
@@ -938,9 +938,9 @@ class NsrTopic(BaseTopic):
             for index in range(0, count):
                 vdur = deepcopy(vdur)
                 for iface in vdur["interfaces"]:
             for index in range(0, count):
                 vdur = deepcopy(vdur)
                 for iface in vdur["interfaces"]:
-                    if iface.get("ip-address"):
+                    if iface.get("ip-address") and index != 0:
                         iface["ip-address"] = increment_ip_mac(iface["ip-address"])
                         iface["ip-address"] = increment_ip_mac(iface["ip-address"])
-                    if iface.get("mac-address"):
+                    if iface.get("mac-address") and index != 0:
                         iface["mac-address"] = increment_ip_mac(iface["mac-address"])
 
                 vdur["_id"] = str(uuid4())
                         iface["mac-address"] = increment_ip_mac(iface["mac-address"])
 
                 vdur["_id"] = str(uuid4())