From ea0cc0a31db1de8fe518c421cc80d54214b23ece Mon Sep 17 00:00:00 2001 From: gcalvino Date: Tue, 6 Nov 2018 13:20:29 +0100 Subject: [PATCH] NS scenarios without VNFs compatibility Signed-off-by: gcalvino --- osm_lcm/ROclient.py | 2 +- osm_lcm/ns.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osm_lcm/ROclient.py b/osm_lcm/ROclient.py index ec31b39..73a1b13 100644 --- a/osm_lcm/ROclient.py +++ b/osm_lcm/ROclient.py @@ -104,7 +104,7 @@ class ROClient: mandatory_for_create = { 'tenant': ("name", ), 'vnfd': ("name", "id", "connection-point", "vdu"), - 'nsd': ("name", "id", "constituent-vnfd"), + 'nsd': ("name", "id"), 'ns': ("name", "scenario", "datacenter"), 'vim': ("name", "vim_url"), 'vim_account': (), diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 630c80a..35d80a0 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -687,7 +687,7 @@ class NsLcm(LcmBase): 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) @@ -875,7 +875,7 @@ class NsLcm(LcmBase): 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] -- 2.17.1