X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=nfvo.py;h=1d95425724517342c3c53a6a5f06b3046948dd41;hb=a3d49e652822eff18b39a2fc43f9d48da17013cc;hp=005e065bdff448bab752538fc3129cf4ab1e3f2b;hpb=5e91eb8987aea037647103633909bf894bbed3c5;p=osm%2FRO.git diff --git a/nfvo.py b/nfvo.py index 005e065b..1d954257 100644 --- a/nfvo.py +++ b/nfvo.py @@ -354,7 +354,7 @@ def create_or_use_flavor(mydb, vims, flavor_dict, rollback_list, only_create_at_ if 'extended' in flavor_dict and flavor_dict['extended']!=None: dev_nb=0 for device in flavor_dict['extended'].get('devices',[]): - if "image" not in device or "image name" not in device: + if "image" not in device and "image name" not in device: continue image_dict={} image_dict['name']=device.get('image name',flavor_dict['name']+str(dev_nb)+"-img") @@ -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')