Skip to content

Commit

Permalink
bgp send-community fix (#487)
Browse files Browse the repository at this point in the history
* fix for send_community

* fix bfd echo intermittent failure

* review comments

* review comment
  • Loading branch information
saichint authored and mikewiebe committed Oct 13, 2016
1 parent 5f812a1 commit a0e5e02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/cisco_node_utils/bgp_neighbor_af.rb
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,16 @@ def default_route_reflector_client
# sense to split up the individual methods to support them
def send_community
val = config_get('bgp_neighbor_af', 'send_community', @get_args)
return default_send_community if val.nil?
return default_send_community if val.nil? || val.empty?
platform == :nexus ? send_community_nexus(val) : send_community_xr(val)
end

# Nexus: <state> send-community [ both | extended | standard ]
# NOTE: 'standard' is default but does not nvgen on some platforms
# Returns: none, both, extended, or standard
def send_community_nexus(val)
val = val.split.last
return 'both' if val.grep(/extended|standard/).size == 2
val = val[0].split.last
return 'standard' if val[/send-community/] # Workaround
val
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ route_reflector_client:
default_value: false

send_community:
multiple:
auto_default: false
default_value: 'none'
nexus:
get_value: '/^send-community(?: .*)?/'
set_value: '<state> send-community <attr>'
ios_xr:
multiple:
# XR three seperate commands: send-community-ebgp send-community-gshut-ebgp
# and send-extended-community-ebgp
# send-community-ebgp' and 'send-extended-community-ebgp' are the equivalents
Expand Down
1 change: 1 addition & 0 deletions tests/test_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ def test_bfd_echo
assert_raises(Cisco::UnsupportedError) { interface.bfd_echo = false }
return
end
interface.switchport_mode = :disabled
assert_equal(interface.default_bfd_echo,
interface.bfd_echo)
interface.bfd_echo = false
Expand Down

0 comments on commit a0e5e02

Please sign in to comment.