feature 1429 add n2vc key to all mgmt vdus 56/6756/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 24 Oct 2018 16:47:11 +0000 (18:47 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 25 Oct 2018 12:39:16 +0000 (14:39 +0200)
Change-Id: I8b469e05f9d6be34f9c3067fcb7de0d6d3dca599
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_lcm/ns.py

index f9244e5..d54187d 100644 (file)
@@ -216,6 +216,9 @@ class NsLcm(LcmBase):
             "vnfs": {},
             "networks": {},
         }
+        if ns_params.get("vduImage"):
+            RO_ns_params["vduImage"] = ns_params["vduImage"]
+
         if ns_params.get("ssh-authorized-key"):
             RO_ns_params["cloud-config"] = {"key-pairs": ns_params["ssh-authorized-key"]}
         if ns_params.get("vnf"):
@@ -544,6 +547,11 @@ class NsLcm(LcmBase):
 
                 step = db_nsr_update["detailed-status"] = "Checking instantiation parameters"
                 RO_ns_params = self.ns_params_2_RO(ns_params, nsd, needed_vnfd)
+
+                n2vc_key = await self.n2vc.GetPublicKey()
+                RO_ns_params["mgmt_keys"] = [n2vc_key]
+                # TODO feature 1429. Add this option only to VMs with configuration and no password
+
                 step = db_nsr_update["detailed-status"] = "Creating ns at RO"
                 desc = await RO.create("ns", descriptor=RO_ns_params,
                                        name=db_nsr["name"],