From: garciadeblas Date: Sun, 23 Jul 2017 17:44:55 +0000 (+0200) Subject: Deployment of VNFs alphabetically ordered by name in a NS instance X-Git-Tag: v3.0.0~17^2~16 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F2036%2F2;p=osm%2FRO.git Deployment of VNFs alphabetically ordered by name in a NS instance Change-Id: I457a41846687d83f13a6a21439dcb445bfd023e0 Signed-off-by: garciadeblas --- 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"] ]