new option for avoid reaching VIMS at new VNF
Change-Id: Ib27ca4c14a59b391cb73994055a51ab80713e6b5
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/nfvo.py b/nfvo.py
index ba670c7..84aec64 100644
--- a/nfvo.py
+++ b/nfvo.py
@@ -547,6 +547,7 @@
# Step 1. Check the VNF descriptor
check_vnf_descriptor(vnf_descriptor, vnf_descriptor_version=1)
# Step 2. Check tenant exist
+ vims = {}
if tenant_id != "any":
check_tenant(mydb, tenant_id)
if "tenant_id" in vnf_descriptor["vnf"]:
@@ -556,9 +557,8 @@
else:
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
- vims = get_vim(mydb, tenant_id)
- else:
- vims={}
+ if global_config["auto_push_VNF_to_VIMs"]:
+ vims = get_vim(mydb, tenant_id)
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor
@@ -681,6 +681,7 @@
# Step 1. Check the VNF descriptor
check_vnf_descriptor(vnf_descriptor, vnf_descriptor_version=2)
# Step 2. Check tenant exist
+ vims = {}
if tenant_id != "any":
check_tenant(mydb, tenant_id)
if "tenant_id" in vnf_descriptor["vnf"]:
@@ -690,9 +691,8 @@
else:
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
- vims = get_vim(mydb, tenant_id)
- else:
- vims={}
+ if global_config["auto_push_VNF_to_VIMs"]:
+ vims = get_vim(mydb, tenant_id)
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor