vnfd_RO.pop("_admin", None)
if new_id:
vnfd_RO["id"] = new_id
- for vdu in vnfd_RO["vdu"]:
+ for vdu in vnfd_RO.get("vdu", ()):
if "cloud-init-file" in vdu:
base_folder = vnfd["_admin"]["storage"]
clout_init_file = "{}/{}/cloud_init/{}".format(
elif vnfd["mgmt-interface"].get("cp"):
mgmt_cp = vnfd["mgmt-interface"]["cp"]
- for vdu in vnfd.get("vdu"):
+ for vdu in vnfd.get("vdu", ()):
if vdu.get("vdu-configuration"):
vdu_needed_access.append(vdu["id"])
elif mgmt_cp:
nsd_RO["id"] = RO_osm_nsd_id
nsd_RO.pop("_id", None)
nsd_RO.pop("_admin", None)
- for c_vnf in nsd_RO["constituent-vnfd"]:
+ for c_vnf in nsd_RO.get("constituent-vnfd", ()):
vnfd_id = c_vnf["vnfd-id-ref"]
c_vnf["vnfd-id-ref"] = descriptor_id_2_RO[vnfd_id]
desc = await RO.create("nsd", descriptor=nsd_RO)
step = "Looking for needed vnfd to configure"
self.logger.debug(logging_text + step)
- for c_vnf in nsd["constituent-vnfd"]:
+ for c_vnf in nsd.get("constituent-vnfd", ()):
vnfd_id = c_vnf["vnfd-id-ref"]
vnf_index = str(c_vnf["member-vnf-index"])
vnfd = db_vnfds_ref[vnfd_id]
# Deploy charms for each VDU that supports one.
vdu_index = 0
- for vdu in vnfd['vdu']:
+ for vdu in vnfd.get('vdu', ()):
vdu_config = vdu.get('vdu-configuration')
proxy_charm = None
config_primitive = None