diff options
-rw-r--r-- | ryu/services/protocols/bgp/api/prefix.py | 5 | ||||
-rw-r--r-- | ryu/services/protocols/bgp/bgpspeaker.py | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/ryu/services/protocols/bgp/api/prefix.py b/ryu/services/protocols/bgp/api/prefix.py index 0751f2f5..c169ed82 100644 --- a/ryu/services/protocols/bgp/api/prefix.py +++ b/ryu/services/protocols/bgp/api/prefix.py @@ -127,8 +127,7 @@ SUPPORTTED_FLOWSPEC_ACTIONS = ( # Constants for ESI Label extended community REDUNDANCY_MODE_ALL_ACTIVE = 'all_active' REDUNDANCY_MODE_SINGLE_ACTIVE = 'single_active' -REDUNDANCY_MODE_TYPES = [ - None, +SUPPORTED_REDUNDANCY_MODES = [ REDUNDANCY_MODE_ALL_ACTIVE, REDUNDANCY_MODE_SINGLE_ACTIVE, ] @@ -206,7 +205,7 @@ def is_valid_ethernet_tag_id(ethernet_tag_id): @validate(name=REDUNDANCY_MODE) def is_valid_redundancy_mode(redundancy_mode): - if redundancy_mode not in REDUNDANCY_MODE_TYPES: + if redundancy_mode not in SUPPORTED_REDUNDANCY_MODES: raise ConfigValueError(conf_name=REDUNDANCY_MODE, conf_value=redundancy_mode) diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py index cfb0c8e4..723fc2ad 100644 --- a/ryu/services/protocols/bgp/bgpspeaker.py +++ b/ryu/services/protocols/bgp/bgpspeaker.py @@ -683,14 +683,20 @@ class BGPSpeaker(object): # Set route type specific arguments if route_type == EVPN_ETH_AUTO_DISCOVERY: - # REDUNDANCY_MODE is parameter for extended community kwargs.update({ EVPN_ESI: esi, EVPN_ETHERNET_TAG_ID: ethernet_tag_id, - REDUNDANCY_MODE: redundancy_mode, }) if vni is not None: kwargs[EVPN_VNI] = vni + # Set Redundancy Mode Attribute arguments + if redundancy_mode in [ + REDUNDANCY_MODE_ALL_ACTIVE, + REDUNDANCY_MODE_SINGLE_ACTIVE]: + kwargs[REDUNDANCY_MODE] = redundancy_mode + elif redundancy_mode is not None: + raise ValueError('Unsupported Redundancy Mode: %s' % + redundancy_mode) elif route_type == EVPN_MAC_IP_ADV_ROUTE: kwargs.update({ EVPN_ESI: esi, |