From 5251d6dad5cf171d01de258da3c9ff87d833ad77 Mon Sep 17 00:00:00 2001 From: Felipe Vicens Date: Sat, 24 Nov 2018 09:56:39 +0100 Subject: [PATCH] Supporting ns params in NSI creation Change-Id: I56cf8a7ecd692777ff6a5ae1c5b6d8cac48f1bca Signed-off-by: Felipe Vicens --- osm_nbi/instance_topics.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index e53f28e..b6e025f 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -830,6 +830,8 @@ class NsiTopic(BaseTopic): self.format_on_new(nsi_descriptor, session["project_id"], make_public=make_public) nsi_descriptor["_admin"]["nsiState"] = "NOT_INSTANTIATED" + ns_params = indata.get("ns") + # creates Network Services records (NSRs) step = "creating nsrs at database using NsrTopic.new()" nsrs_list = [] @@ -841,6 +843,11 @@ class NsiTopic(BaseTopic): indata_ns["nsDescription"] = service["description"] indata_ns["key-pair-ref"] = None # NsrTopic(rollback, session, indata_ns, kwargs, headers, force) + # Overwriting ns_params filtering by nsName == netslice-subnet.id + if ns_params: + for ns_param in ns_params: + if ns_param["nsName"] == service["id"]: + indata_ns.update(ns_param) _id_nsr = NsrTopic.new(self, rollback, session, indata_ns, kwargs, headers, force) nsrs_item = {"nsrId": _id_nsr} nsrs_list.append(nsrs_item) -- 2.25.1