From 2fce5f131d75100f7b753b9c05726ef972d7220c Mon Sep 17 00:00:00 2001 From: tierno Date: Mon, 26 Sep 2016 15:12:15 +0000 Subject: [PATCH] v0.4.58 fixed getting VIM ip_address issue when several scenario network are mapped to the same VIM network Signed-off-by: tierno --- nfvo.py | 14 +++++++------- openmanod.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nfvo.py b/nfvo.py index cc2ed7f1..dd3eb55b 100644 --- a/nfvo.py +++ b/nfvo.py @@ -2085,7 +2085,7 @@ def refresh_instance(mydb, nfvo_tenant, instanceDict, datacenter=None, vim_tenan if iface["type"]=="mgmt": has_mgmt_iface = True if vm_dict[vm_id]['status'] == "ACTIVE:NoMgmtIP" and not has_mgmt_iface: - vm_dict[vm_id]['status'] = "ACTIVE" + vm_dict[vm_id]['status'] = "ACTIVE" if vm['status'] != vm_dict[vm_id]['status'] or vm.get('error_msg')!=vm_dict[vm_id].get('error_msg') or vm.get('vim_info')!=vm_dict[vm_id].get('vim_info'): vm['status'] = vm_dict[vm_id]['status'] vm['error_msg'] = vm_dict[vm_id].get('error_msg') @@ -2101,16 +2101,16 @@ def refresh_instance(mydb, nfvo_tenant, instanceDict, datacenter=None, vim_tenan # 2.2. Update in openmano DB the interface VMs for interface in interfaces: #translate from vim_net_id to instance_net_id - network_id=None + network_id_list=[] for net in instanceDict['nets']: if net["vim_net_id"] == interface["vim_net_id"]: - network_id = net["uuid"] - break - if not network_id: + network_id_list.append(net["uuid"]) + if not network_id_list: continue del interface["vim_net_id"] - try: - mydb.update_rows('instance_interfaces', UPDATE=interface, WHERE={'instance_vm_id':vm["uuid"], "instance_net_id":network_id}) + try: + for network_id in network_id_list: + mydb.update_rows('instance_interfaces', UPDATE=interface, WHERE={'instance_vm_id':vm["uuid"], "instance_net_id":network_id}) except db_base_Exception as e: logger.error( "nfvo.refresh_instance error with vm=%s, interface_net_id=%s", vm["uuid"], network_id) diff --git a/openmanod.py b/openmanod.py index 02c51c89..2becccff 100755 --- a/openmanod.py +++ b/openmanod.py @@ -33,7 +33,7 @@ It loads the configuration file and launches the http_server thread that will li ''' __author__="Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ ="$26-aug-2014 11:09:29$" -__version__="0.4.57-r499" +__version__="0.4.58-r501" version_date="Sep 2016" database_version="0.14" #expected database schema version -- 2.25.1