From acd4e781d6c2d553bb469df9f0fcdab0c4c431c5 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Sun, 23 Jul 2017 19:44:55 +0200 Subject: [PATCH] Deployment of VNFs alphabetically ordered by name in a NS instance Change-Id: I457a41846687d83f13a6a21439dcb445bfd023e0 Signed-off-by: garciadeblas --- osm_ro/nfvo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index a5599418..94b029aa 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -2191,7 +2191,9 @@ def create_instance(mydb, tenant_id, instance_dict): # 3. Creating new vm instances in the VIM #myvim.new_vminstance(self,vimURI,tenant_id,name,description,image_id,flavor_id,net_dict) - for sce_vnf in scenarioDict['vnfs']: + sce_vnf_list = sorted(scenarioDict['vnfs'], key=lambda k: k['name']) + #for sce_vnf in scenarioDict['vnfs']: + for sce_vnf in sce_vnf_list: if sce_vnf.get("datacenter"): vim = myvims[ sce_vnf["datacenter"] ] myvim_thread_id = myvim_threads_id[ sce_vnf["datacenter"] ] -- 2.25.1