From 911ff7dfb3ed1164e52d1e8ac90d029cc548fe3b Mon Sep 17 00:00:00 2001 From: gcalvino Date: Tue, 13 Nov 2018 17:19:32 +0100 Subject: [PATCH] VNFs with only VLDs compatibility Signed-off-by: gcalvino --- osm_lcm/ROclient.py | 4 ++-- osm_lcm/ns.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osm_lcm/ROclient.py b/osm_lcm/ROclient.py index 73a1b13..d0bef33 100644 --- a/osm_lcm/ROclient.py +++ b/osm_lcm/ROclient.py @@ -103,7 +103,7 @@ class ROClient: 'ns': 'instances'} mandatory_for_create = { 'tenant': ("name", ), - 'vnfd': ("name", "id", "connection-point", "vdu"), + 'vnfd': ("name", "id"), 'nsd': ("name", "id"), 'ns': ("name", "scenario", "datacenter"), 'vim': ("name", "vim_url"), @@ -353,7 +353,7 @@ class ROClient: """ ns_info = {} for vnf in ns_descriptor["vnfs"]: - if not vnf.get("ip_address"): + if not vnf.get("ip_address") and vnf.get("vms"): raise ROClientException("ns member_vnf_index '{}' has no IP address".format( vnf["member_vnf_index"]), http_code=409) vnfr_info = { diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 35d80a0..3126b17 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -149,7 +149,7 @@ class NsLcm(LcmBase): 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( @@ -310,7 +310,7 @@ class NsLcm(LcmBase): 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: @@ -900,7 +900,7 @@ class NsLcm(LcmBase): # 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 -- 2.17.1