"source_ip": match["source_ip"],
"destination_ip": match["destination_ip"],
"source_port": match["source_port"],
- "destination_port": match["destination_port"]
+ "destination_port": match["destination_port"],
+ "logical_source_port": classifier["interface_id"]
}
db_vim_action = {
"instance_action_id": instance_action_id,
else:
netDict['net_id'] = "TASK-{}".format(net2task_id[sce_vnf['uuid']][iface['net_id']])
instance_net_id = vnf_net2instance[sce_vnf['uuid']][iface['net_id']]
+ instance_wim_net_id = None
task_depends_on.append(net2task_id[sce_vnf['uuid']][iface['net_id']])
# skip bridge ifaces not connected to any net
if 'net_id' not in netDict or netDict['net_id'] == None:
return vim_action_get(mydb, tenant_id, datacenter, item, content)
def sdn_controller_create(mydb, tenant_id, sdn_controller):
- wim_id = ovim.new_of_controller(sdn_controller)
+ try:
+ wim_id = ovim.new_of_controller(sdn_controller)
- thread_name = get_non_used_vim_name(sdn_controller['name'], wim_id, wim_id, None)
- new_thread = vim_thread(task_lock, plugins, thread_name, wim_id, None, db=db)
- new_thread.start()
- thread_id = wim_id
- vim_threads["running"][thread_id] = new_thread
- logger.debug('New SDN controller created with uuid {}'.format(wim_id))
- return wim_id
+ thread_name = get_non_used_vim_name(sdn_controller['name'], wim_id, wim_id, None)
+ new_thread = vim_thread(task_lock, plugins, thread_name, wim_id, None, db=db)
+ new_thread.start()
+ thread_id = wim_id
+ vim_threads["running"][thread_id] = new_thread
+ logger.debug('New SDN controller created with uuid {}'.format(wim_id))
+ return wim_id
+ except ovimException as e:
+ raise NfvoException(e) from e
def sdn_controller_update(mydb, tenant_id, controller_id, sdn_controller):
data = ovim.edit_of_controller(controller_id, sdn_controller)
private_key = key.exportKey(passphrase=tenant_id, pkcs=8)
except (ValueError, NameError) as e:
raise NfvoException("Unable to create private key: {}".format(e), httperrors.Internal_Server_Error)
+ if isinstance(public_key, bytes):
+ public_key = public_key.decode(encoding='UTF-8')
+ if isinstance(private_key, bytes):
+ private_key = private_key.decode(encoding='UTF-8')
return public_key, private_key
def decrypt_key (key, tenant_id):
unencrypted_key = key.exportKey('PEM')
if isinstance(unencrypted_key, ValueError):
raise NfvoException("Unable to decrypt the private key: {}".format(unencrypted_key), httperrors.Internal_Server_Error)
+ if isinstance(unencrypted_key, bytes):
+ unencrypted_key = unencrypted_key.decode(encoding='UTF-8')
except ValueError as e:
raise NfvoException("Unable to decrypt the private key: {}".format(e), httperrors.Internal_Server_Error)
return unencrypted_key