From: Felipe Vicens Date: Fri, 9 Aug 2019 13:52:40 +0000 (+0200) Subject: Fix bug 815 - Increased the granularity of the netslice subnet filters for shared... X-Git-Tag: v6.0.2rc1~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F7842%2F1;p=osm%2FNBI.git Fix bug 815 - Increased the granularity of the netslice subnet filters for shared nss selection Change-Id: I71beb2d73da3f31e2314f29e4c9ca1e4e43dcc1f Signed-off-by: Felipe Vicens --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 74504b3..809578e 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -1082,14 +1082,15 @@ class NsiTopic(BaseTopic): # Is the nss shared and instantiated? _filter["_admin.nsrs-detailed-list.ANYINDEX.shared"] = True _filter["_admin.nsrs-detailed-list.ANYINDEX.nsd-id"] = service["nsd-ref"] + _filter["_admin.nsrs-detailed-list.ANYINDEX.nss-id"] = service["id"] nsi = self.db.get_one("nsis", _filter, fail_on_empty=False, fail_on_more=False) - if nsi and service.get("is-shared-nss"): nsrs_detailed_list = nsi["_admin"]["nsrs-detailed-list"] for nsrs_detailed_item in nsrs_detailed_list: if nsrs_detailed_item["nsd-id"] == service["nsd-ref"]: - _id_nsr = nsrs_detailed_item["nsrId"] - break + if nsrs_detailed_item["nss-id"] == service["id"]: + _id_nsr = nsrs_detailed_item["nsrId"] + break for netslice_subnet in nsi["_admin"]["netslice-subnet"]: if netslice_subnet["nss-id"] == service["id"]: indata_ns = netslice_subnet @@ -1118,7 +1119,7 @@ class NsiTopic(BaseTopic): # Creates Nsr objects _id_nsr, _ = self.nsrTopic.new(rollback, session, indata_ns, kwargs, headers) nsrs_item = {"nsrId": _id_nsr, "shared": service.get("is-shared-nss"), "nsd-id": service["nsd-ref"], - "nslcmop_instantiate": None} + "nss-id": service["id"], "nslcmop_instantiate": None} indata_ns["nss-id"] = service["id"] nsrs_list.append(nsrs_item) nsi_netslice_subnet.append(indata_ns)