From: garciadeblas Date: Mon, 9 Dec 2019 21:31:41 +0000 (+0100) Subject: ONOS VPLS SDN plugin: migrated string operator to format to be py3 compliant X-Git-Tag: v7.0.0rc1~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F8359%2F2;p=osm%2FRO.git ONOS VPLS SDN plugin: migrated string operator to format to be py3 compliant Change-Id: I46af69b340aa32681e76cb0e2d885189df073cbb Signed-off-by: garciadeblas --- diff --git a/RO-SDN-onos_vpls/osm_rosdn_onosvpls/sdn_assist_onos_vpls.py b/RO-SDN-onos_vpls/osm_rosdn_onosvpls/sdn_assist_onos_vpls.py index 86caa2ce..8531444e 100644 --- a/RO-SDN-onos_vpls/osm_rosdn_onosvpls/sdn_assist_onos_vpls.py +++ b/RO-SDN-onos_vpls/osm_rosdn_onosvpls/sdn_assist_onos_vpls.py @@ -70,7 +70,7 @@ class OnosVpls(SdnConnectorBase): for vpls in onos_config['apps']['org.onosproject.vpls']['vpls']['vplsList']: if vpls['name'] == service_uuid: return vpls - raise SdnConnectorError('VPLS %s not found' % service_uuid, http_code=404) + raise SdnConnectorError('VPLS {} not found'.format(service_uuid), http_code=404) def create_connectivity_service(self, service_type, connection_points): if service_type.lower() != 'elan': @@ -87,7 +87,7 @@ class OnosVpls(SdnConnectorBase): } for vpls in onos_config['apps']['org.onosproject.vpls']['vpls']['vplsList']: if vpls['name'] == service_uuid: - raise SdnConnectorError('Network %s already exists.' % service_uuid) + raise SdnConnectorError('Network {} already exists.'.format(service_uuid)) onos_config['apps']['org.onosproject.vpls']['vpls']['vplsList'].append({ 'name': service_uuid, 'interfaces': [] @@ -176,7 +176,7 @@ class OnosVpls(SdnConnectorBase): onos_config['apps']['org.onosproject.vpls']['vpls'].pop('lastUpdateTime') def _append_port_to_onos_config(self, port, onos_config): - port_name = 'of:%s/%s' % (port['service_endpoint_encapsulation_info']['switch_dpid'], + 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'][