From 21f18b50618272ae7cf26d2c1dda56df23c04c68 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Wed, 13 Oct 2021 16:42:49 +0200 Subject: [PATCH] Use constants imported from API base Backport of https://github.com/faucetsdn/ryu/commit/a09cae5a Story: #2009283 Task: #43620 Change-Id: I5c59a12678e407fd922608e5ee382dfb87209a67 --- os_ken/services/protocols/bgp/bgpspeaker.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/os_ken/services/protocols/bgp/bgpspeaker.py b/os_ken/services/protocols/bgp/bgpspeaker.py index c3decf3c..095ce287 100644 --- a/os_ken/services/protocols/bgp/bgpspeaker.py +++ b/os_ken/services/protocols/bgp/bgpspeaker.py @@ -43,6 +43,8 @@ from os_ken.services.protocols.bgp.api.base import ROUTE_FAMILY from os_ken.services.protocols.bgp.api.base import EVPN_VNI from os_ken.services.protocols.bgp.api.base import TUNNEL_TYPE from os_ken.services.protocols.bgp.api.base import PMSI_TUNNEL_TYPE +from os_ken.services.protocols.bgp.api.base import MAC_MOBILITY +from os_ken.services.protocols.bgp.api.base import TUNNEL_ENDPOINT_IP from os_ken.services.protocols.bgp.api.prefix import EVPN_MAX_ET from os_ken.services.protocols.bgp.api.prefix import ESI_TYPE_LACP from os_ken.services.protocols.bgp.api.prefix import ESI_TYPE_L2_BRIDGE @@ -811,7 +813,7 @@ class BGPSpeaker(object): # Pass on mac_mobility, must be integer value if mac_mobility is not None: - kwargs['mac_mobility'] = int(mac_mobility) + kwargs[MAC_MOBILITY] = int(mac_mobility) elif route_type == EVPN_MULTICAST_ETAG_ROUTE: kwargs.update({ EVPN_ETHERNET_TAG_ID: ethernet_tag_id, @@ -830,7 +832,7 @@ class BGPSpeaker(object): pmsi_tunnel_type) # Set non-default tunnel endpoint IP, if provided if tunnel_endpoint_ip is not None: - kwargs['tunnel_endpoint_ip'] = tunnel_endpoint_ip + kwargs[TUNNEL_ENDPOINT_IP] = tunnel_endpoint_ip elif route_type == EVPN_ETH_SEGMENT: kwargs.update({ EVPN_ESI: esi, @@ -849,7 +851,7 @@ class BGPSpeaker(object): # Add mac_mobility if mac_mobility is not None: - kwargs['mac_mobility'] = int(mac_mobility) + kwargs[MAC_MOBILITY] = int(mac_mobility) else: raise ValueError('Unsupported EVPN route type: %s' % route_type)