- port_name = 'of:{}/{}'.format(port['service_endpoint_encapsulation_info']['switch_dpid'],
- port['service_endpoint_encapsulation_info']['switch_port'])
- interface_config = {'name': port['service_endpoint_id']}
- if 'vlan' in port['service_endpoint_encapsulation_info'] \
- and port['service_endpoint_encapsulation_info']['vlan']:
- interface_config['vlan'] = port['service_endpoint_encapsulation_info']['vlan']
- if port_name in onos_config['ports'] and 'interfaces' in onos_config['ports'][port_name]:
- for interface in onos_config['ports'][port_name]['interfaces']:
- if interface['name'] == port['service_endpoint_id']:
- #self.logger.debug("interface with same name and port exits")
+ port_name = "of:{}/{}".format(
+ port["service_endpoint_encapsulation_info"]["switch_dpid"],
+ port["service_endpoint_encapsulation_info"]["switch_port"],
+ )
+ interface_config = {"name": port["service_endpoint_id"]}
+
+ if (
+ "vlan" in port["service_endpoint_encapsulation_info"]
+ and port["service_endpoint_encapsulation_info"]["vlan"]
+ ):
+ interface_config["vlan"] = port["service_endpoint_encapsulation_info"][
+ "vlan"
+ ]
+
+ if (
+ port_name in onos_config["ports"]
+ and "interfaces" in onos_config["ports"][port_name]
+ ):
+ for interface in onos_config["ports"][port_name]["interfaces"]:
+ if interface["name"] == port["service_endpoint_id"]:
+ # self.logger.debug("interface with same name and port exits")