#if network is of type vlan and port is of type direct (sr-iov) then set vlan id
network = self.neutron.show_network(port["network_id"])
if network['network'].get('provider:network_type') == 'vlan' and \
- port.get("binding:vnic_type") == "direct":
+ port.get("binding:vnic_type") in ("direct", "direct-physical"):
interface["vlan"] = network['network'].get('provider:segmentation_id')
ips=[]
#look for floating ip address
new_connected_ports.append(external_port_id)
# if there are more ports to connect or they have been modified, call create/update
- if (set(connected_ports) != set(new_connected_ports) or sdn_need_update) and len(sdn_ports) >= 2:
- last_update = time.time()
- if not wimconn_net_id:
- if params[0] == "data":
- net_type = "ELAN"
- elif params[0] == "ptp":
- net_type = "ELINE"
- else:
- net_type = "L3"
+ try:
+ if (set(connected_ports) != set(new_connected_ports) or sdn_need_update) and len(sdn_ports) >= 2:
+ last_update = time.time()
+ if not wimconn_net_id:
+ if params[0] == "data":
+ net_type = "ELAN"
+ elif params[0] == "ptp":
+ net_type = "ELINE"
+ else:
+ net_type = "L3"
- wimconn_net_id, created_items = self.sdnconnector.create_connectivity_service(net_type, sdn_ports)
- else:
- created_items = self.sdnconnector.edit_connectivity_service(wimconn_net_id, conn_info=created_items,
- connection_points=sdn_ports)
- connected_ports = new_connected_ports
- elif wimconn_net_id:
- try:
+ wimconn_net_id, created_items = self.sdnconnector.create_connectivity_service(
+ net_type, sdn_ports)
+ else:
+ created_items = self.sdnconnector.edit_connectivity_service(
+ wimconn_net_id, conn_info=created_items, connection_points=sdn_ports)
+ connected_ports = new_connected_ports
+ elif wimconn_net_id:
wim_status_dict = self.sdnconnector.get_connectivity_service_status(wimconn_net_id,
conn_info=created_items)
sdn_status = wim_status_dict["sdn_status"]
error_list.append(wim_status_dict.get("error_msg"))
if wim_status_dict.get("sdn_info"):
sdn_info = str(wim_status_dict.get("sdn_info"))
- except Exception as e:
- self._proccess_sdn_exception(e)
+ except Exception as e:
+ self._proccess_sdn_exception(e)
task["status"] = "DONE"
task["extra"]["vim_info"] = {}
# task["extra"]["sdn_net_id"] = sdn_net_id
instance_element_update = {"wim_internal_id": wimconn_net_id, "status": "WIM_ERROR",
"error_msg": task["error_msg"]}
+
if sdn_info:
instance_element_update["wim_info"] = sdn_info
return instance_element_update