From a3d49e652822eff18b39a2fc43f9d48da17013cc Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 5 Oct 2016 15:20:26 +0000 Subject: [PATCH] v0.5.1 fixed 75 VIM VM or net not updated when receives a message error longer than 1024 Signed-off-by: tierno --- nfvo.py | 4 ++++ openmanod.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nfvo.py b/nfvo.py index 9f360ce1..1d954257 100644 --- a/nfvo.py +++ b/nfvo.py @@ -2169,6 +2169,8 @@ def refresh_instance(mydb, nfvo_tenant, instanceDict, datacenter=None, vim_tenan has_mgmt_iface = True if vm_dict[vm_id]['status'] == "ACTIVE:NoMgmtIP" and not has_mgmt_iface: vm_dict[vm_id]['status'] = "ACTIVE" + if vm_dict[vm_id].get('error_msg') and len(vm_dict[vm_id]['error_msg']) >= 1024: + vm_dict[vm_id]['error_msg'] = vm_dict[vm_id]['error_msg'][:516] + " ... " + vm_dict[vm_id]['error_msg'][-500:] 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') @@ -2221,6 +2223,8 @@ def refresh_instance(mydb, nfvo_tenant, instanceDict, datacenter=None, vim_tenan # TODO: update nets inside a vnf for net in instanceDict['nets']: net_id = net['vim_net_id'] + if net_dict[net_id].get('error_msg') and len(net_dict[net_id]['error_msg']) >= 1024: + net_dict[net_id]['error_msg'] = net_dict[net_id]['error_msg'][:516] + " ... " + net_dict[vm_id]['error_msg'][-500:] if net['status'] != net_dict[net_id]['status'] or net.get('error_msg')!=net_dict[net_id].get('error_msg') or net.get('vim_info')!=net_dict[net_id].get('vim_info'): net['status'] = net_dict[net_id]['status'] net['error_msg'] = net_dict[net_id].get('error_msg') diff --git a/openmanod.py b/openmanod.py index 7d183eb7..fcfd11c6 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.5.0-r507" +__version__="0.5.1-r508" version_date="Oct 2016" database_version="0.15" #expected database schema version -- 2.25.1