From: tierno Date: Tue, 2 Jul 2019 09:28:40 +0000 (+0000) Subject: fix ssh-keys passed from NSI to NSR X-Git-Tag: v6.0.1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=44459c557aad45b2bbd862020188d6f363423a39;p=osm%2FNBI.git fix ssh-keys passed from NSI to NSR Change-Id: Ie729872b7815e7d5d7ebc4acdc29136282fc3309 Signed-off-by: tierno --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index eb632ac..ce9a3c6 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -181,6 +181,7 @@ class NsrTopic(BaseTopic): """ try: + step = "validating input parameters" ns_request = self._remove_envelop(indata) # Override descriptor with query string kwargs self._update_input_with_kwargs(ns_request, kwargs) @@ -227,7 +228,7 @@ class NsrTopic(BaseTopic): "id": nsr_id, "_id": nsr_id, # "input-parameter": xpath, value, - "ssh-authorized-key": ns_request.get("key-pair-ref"), # TODO remove + "ssh-authorized-key": ns_request.get("ssh_keys"), # TODO remove } ns_request["nsr_id"] = nsr_id # Create vld @@ -988,12 +989,12 @@ class NsiTopic(BaseTopic): """ try: + step = "" slice_request = self._remove_envelop(indata) # Override descriptor with query string kwargs self._update_input_with_kwargs(slice_request, kwargs) self._validate_input_new(slice_request, session["force"]) - step = "" # look for nstd step = "getting nstd id='{}' from database".format(slice_request.get("nstId")) _filter = self._get_project_filter(session) @@ -1102,7 +1103,8 @@ class NsiTopic(BaseTopic): indata_ns["nsName"] = slice_request.get("nsiName") + "." + service["id"] indata_ns["vimAccountId"] = slice_request.get("vimAccountId") indata_ns["nsDescription"] = service["description"] - indata_ns["key-pair-ref"] = slice_request.get("key-pair-ref") + if slice_request.get("ssh_keys"): + indata_ns["ssh_keys"] = slice_request.get("ssh_keys") if ns_params: for ns_param in ns_params: @@ -1293,8 +1295,7 @@ class NsiLcmOpTopic(BaseTopic): indata_ns["nsInstanceId"] = service["_id"] # Including netslice_id in the ns instantiate Operation indata_ns["netsliceInstanceId"] = netsliceInstanceId - del indata_ns["key-pair-ref"] - # Creating NS_LCM_OP with the flag slice_object=True to not trigger the service instantiation + # Creating NS_LCM_OP with the flag slice_object=True to not trigger the service instantiation # message via kafka bus nslcmop = self.nsi_NsLcmOpTopic.new(rollback, session, indata_ns, kwargs, headers, slice_object=True)