raise LcmException("Error parsing Jinja2 to cloud-init content at vnfd[id={}]:vdu[id={}]: {}".
format(vnfd["id"], vdu["id"], e))
- def ns_params_2_RO(self, ns_params, nsd, vnfd_dict, n2vc_key_list):
+ def _ns_params_2_RO(self, ns_params, nsd, vnfd_dict, n2vc_key_list):
"""
Creates a RO ns descriptor from OSM ns_instantiate params
:param ns_params: OSM instantiate params
await asyncio.wait(task_dependency, timeout=3600)
stage[2] = "Checking instantiation parameters."
- RO_ns_params = self.ns_params_2_RO(ns_params, nsd, db_vnfds_ref, n2vc_key_list)
+ RO_ns_params = self._ns_params_2_RO(ns_params, nsd, db_vnfds_ref, n2vc_key_list)
stage[2] = "Deploying ns at VIM."
db_nsr_update["detailed-status"] = " ".join(stage)
self.update_db_2("nsrs", nsr_id, db_nsr_update)
for kdur in get_iterable(vnfr_data, "kdur"):
desc_params = self._format_additional_params(kdur.get("additionalParams"))
vnfd_id = vnfr_data.get('vnfd-id')
+ namespace = kdur.get("k8s-namespace")
if kdur.get("helm-chart"):
kdumodel = kdur["helm-chart"]
k8sclustertype = "helm-chart"
"k8scluster-type": k8sclustertype,
"member-vnf-index": vnfr_data["member-vnf-index-ref"],
"kdu-name": kdur["kdu-name"],
- "kdu-model": kdumodel}
+ "kdu-model": kdumodel,
+ "namespace": namespace}
db_nsr_update["_admin.deployed.K8s.{}".format(index)] = k8s_instace_info
self.update_db_2("nsrs", nsr_id, db_nsr_update)
self.k8scluster_map[k8sclustertype].install(cluster_uuid=cluster_uuid, kdu_model=kdumodel,
atomic=True, params=desc_params,
db_dict=db_dict, timeout=600,
- kdu_name=kdur["kdu-name"]))
+ kdu_name=kdur["kdu-name"], namespace=namespace))
self.lcm_tasks.register("ns", nsr_id, nslcmop_id, "instantiate_KDU-{}".format(index), task)
task_instantiation_info[task] = "Deploying KDU {}".format(kdur["kdu-name"])
nsd["constituent-vnfd"].append({"vnfd-id-ref": k, "member-vnf-index": k})
n2vc_key_list = ["key"]
- ro_ns_params = self.my_ns.ns_params_2_RO(ns_params, nsd, vnfd_dict, n2vc_key_list)
+ ro_ns_params = self.my_ns._ns_params_2_RO(ns_params, nsd, vnfd_dict, n2vc_key_list)
ro_params_expected = {'wim_account': None, "datacenter": ro_vim_id,
"vnfs": {"5": {"vdus": {"vdu_id": {"mgmt_keys": n2vc_key_list}}}}}
self.assertEqual(ro_ns_params, ro_params_expected)
k8s_instace_info = {"kdu-instance": None, "k8scluster-uuid": "73d96432-d692-40d2-8440-e0c73aee209c",
"k8scluster-type": "helm-chart",
"kdu-name": "ldap", "kdu-model": "stable/openldap:1.2.1",
- "member-vnf-index": "multikdu"}
+ "member-vnf-index": "multikdu", "namespace": None}
self.assertEqual(db_nsr["_admin"]["deployed"]["K8s"][0], k8s_instace_info)
k8s_instace_info["kdu-name"] = "mongo"