From 1d55a23c9cd32f17bb7a6f21e5b6c2b476c5804f Mon Sep 17 00:00:00 2001 From: calvinosanch Date: Mon, 5 Aug 2019 11:03:46 +0000 Subject: [PATCH] Bug782 fix: use_existing_flavors flag was not working Change-Id: Icca64e75d68ef6eb4bda2f446851d3ac4c02d231 Signed-off-by: calvinosanch --- osm_ro/nfvo.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index 15f04d6e..9a2e5e1c 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -1282,13 +1282,21 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): numa["threads"] = max(db_flavor["vcpus"], 1) epa_vcpu_set = True if vdu["guest-epa"].get("cpu-quota") and not epa_vcpu_set: - extended["cpu-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("cpu-quota")) + cpuquota = get_resource_allocation_params(vdu["guest-epa"].get("cpu-quota")) + if cpuquota: + extended["cpu-quota"] = cpuquota if vdu["guest-epa"].get("mem-quota"): - extended["mem-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("mem-quota")) + vduquota = get_resource_allocation_params(vdu["guest-epa"].get("mem-quota")) + if vduquota: + extended["mem-quota"] = vduquota if vdu["guest-epa"].get("disk-io-quota"): - extended["disk-io-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("disk-io-quota")) + diskioquota = get_resource_allocation_params(vdu["guest-epa"].get("disk-io-quota")) + if diskioquota: + extended["disk-io-quota"] = diskioquota if vdu["guest-epa"].get("vif-quota"): - extended["vif-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("vif-quota")) + vifquota = get_resource_allocation_params(vdu["guest-epa"].get("vif-quota")) + if vifquota: + extended["vif-quota"] = vifquota if numa: extended["numas"] = [numa] if extended: -- 2.25.1