From: sousaedu Date: Mon, 1 Mar 2021 23:19:15 +0000 (+0100) Subject: Fix bug 1430 X-Git-Tag: branch-sol006v331-start~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=003844ea3f8ab2f9e1486a9cce06d7bcce97bad7;p=osm%2FNBI.git Fix bug 1430 Change-Id: I62a8e017345ea5c231248b06b75ea583ebd58e25 Signed-off-by: sousaedu --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 7b3e9ad..cae9f54 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -586,12 +586,6 @@ class NsrTopic(BaseTopic): "name": icp.get("id"), } - if "port-security-enabled" in icp: - vdu_icp["port-security-enabled"] = icp["port-security-enabled"] - - if "port-security-disable-strategy" in icp: - vdu_icp["port-security-disable-strategy"] = icp["port-security-disable-strategy"] - vdur["internal-connection-point"].append(vdu_icp) for iface in icp.get("virtual-network-interface-requirement", ()): @@ -599,6 +593,12 @@ class NsrTopic(BaseTopic): vdu_iface = {x: iface[x] for x in iface_fields if iface.get(x) is not None} vdu_iface["internal-connection-point-ref"] = vdu_icp["id"] + if "port-security-enabled" in icp: + vdu_iface["port-security-enabled"] = icp["port-security-enabled"] + + if "port-security-disable-strategy" in icp: + vdu_iface["port-security-disable-strategy"] = icp["port-security-disable-strategy"] + for ext_cp in vnfd.get("ext-cpd", ()): if not ext_cp.get("int-cpd"): continue @@ -606,6 +606,17 @@ class NsrTopic(BaseTopic): continue if icp["id"] == ext_cp["int-cpd"].get("cpd"): vdu_iface["external-connection-point-ref"] = ext_cp.get("id") + + if "port-security-enabled" in ext_cp: + vdu_iface["port-security-enabled"] = ( + ext_cp["port-security-enabled"] + ) + + if "port-security-disable-strategy" in ext_cp: + vdu_iface["port-security-disable-strategy"] = ( + ext_cp["port-security-disable-strategy"] + ) + break if vnfd_mgmt_cp and vdu_iface.get("external-connection-point-ref") == vnfd_mgmt_cp: