v0.5.1 fixed 75 VIM VM or net not updated when receives a message error longer than... 11/511/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 5 Oct 2016 15:20:26 +0000 (15:20 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 5 Oct 2016 15:43:08 +0000 (15:43 +0000)
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
nfvo.py
openmanod.py

diff --git a/nfvo.py b/nfvo.py
index 9f360ce..1d95425 100644 (file)
--- 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')
index 7d183eb..fcfd11c 100755 (executable)
@@ -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