Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com> --- ryu/services/protocols/bgp/api/prefix.py | 5 ++--- 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 0751f2f..c169ed8 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 d943082..220c69e 100644 --- a/ryu/services/protocols/bgp/bgpspeaker.py +++ b/ryu/services/protocols/bgp/bgpspeaker.py @@ -676,14 +676,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, -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel