cisco_node_utils 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +66 -0
  4. data/Gemfile +1 -0
  5. data/README.md +44 -43
  6. data/bin/.rubocop.yml +18 -0
  7. data/bin/show_running_yang.rb +233 -0
  8. data/cisco_node_utils.gemspec +1 -1
  9. data/docs/README-maintainers.md +1 -0
  10. data/docs/README-utilities.md +14 -0
  11. data/lib/.rubocop.yml +1 -1
  12. data/lib/cisco_node_utils/aaa_authentication_login_service.rb +8 -3
  13. data/lib/cisco_node_utils/aaa_authorization_service.rb +6 -0
  14. data/lib/cisco_node_utils/bfd_global.rb +300 -0
  15. data/lib/cisco_node_utils/bgp.rb +6 -4
  16. data/lib/cisco_node_utils/bgp_af.rb +2 -0
  17. data/lib/cisco_node_utils/bgp_neighbor.rb +14 -0
  18. data/lib/cisco_node_utils/bgp_neighbor_af.rb +4 -1
  19. data/lib/cisco_node_utils/cisco_cmn_utils.rb +126 -0
  20. data/lib/cisco_node_utils/client/client.rb +6 -2
  21. data/lib/cisco_node_utils/client/grpc/client.rb +120 -36
  22. data/lib/cisco_node_utils/client/nxapi/client.rb +6 -2
  23. data/lib/cisco_node_utils/cmd_ref/DEPRECATED.yaml +118 -0
  24. data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +14 -0
  25. data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +117 -0
  26. data/lib/cisco_node_utils/cmd_ref/bgp.yaml +7 -7
  27. data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +7 -0
  28. data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +125 -0
  29. data/lib/cisco_node_utils/cmd_ref/feature.yaml +10 -0
  30. data/lib/cisco_node_utils/cmd_ref/interface.yaml +141 -49
  31. data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +44 -0
  32. data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +6 -0
  33. data/lib/cisco_node_utils/cmd_ref/ospf.yaml +6 -0
  34. data/lib/cisco_node_utils/cmd_ref/ospf_area.yaml +91 -0
  35. data/lib/cisco_node_utils/cmd_ref/ospf_area_vlink.yaml +88 -0
  36. data/lib/cisco_node_utils/cmd_ref/overlay_global.yaml +0 -3
  37. data/lib/cisco_node_utils/cmd_ref/show_version.yaml +3 -3
  38. data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +39 -15
  39. data/lib/cisco_node_utils/cmd_ref/snmp_notification_receiver.yaml +43 -21
  40. data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +48 -19
  41. data/lib/cisco_node_utils/cmd_ref/snmp_user.yaml +0 -0
  42. data/lib/cisco_node_utils/cmd_ref/tacacs_global.yaml +30 -0
  43. data/lib/cisco_node_utils/cmd_ref/tacacs_server.yaml +18 -6
  44. data/lib/cisco_node_utils/cmd_ref/vdc.yaml +4 -0
  45. data/lib/cisco_node_utils/cmd_ref/virtual_service.yaml +1 -0
  46. data/lib/cisco_node_utils/cmd_ref/vlan.yaml +23 -10
  47. data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +8 -2
  48. data/lib/cisco_node_utils/cmd_ref/yang.yaml +7 -0
  49. data/lib/cisco_node_utils/cmd_ref/yum.yaml +10 -1
  50. data/lib/cisco_node_utils/constants.rb +8 -1
  51. data/lib/cisco_node_utils/dhcp_relay_global.rb +302 -0
  52. data/lib/cisco_node_utils/exceptions.rb +29 -0
  53. data/lib/cisco_node_utils/feature.rb +28 -0
  54. data/lib/cisco_node_utils/interface.rb +493 -402
  55. data/lib/cisco_node_utils/interface_DEPRECATED.rb +513 -0
  56. data/lib/cisco_node_utils/interface_ospf.rb +126 -0
  57. data/lib/cisco_node_utils/interface_portchannel.rb +16 -0
  58. data/lib/cisco_node_utils/logger.rb +3 -0
  59. data/lib/cisco_node_utils/node.rb +29 -1
  60. data/lib/cisco_node_utils/overlay_global.rb +1 -12
  61. data/lib/cisco_node_utils/pim.rb +1 -0
  62. data/lib/cisco_node_utils/pim_group_list.rb +1 -0
  63. data/lib/cisco_node_utils/pim_rp_address.rb +1 -0
  64. data/lib/cisco_node_utils/platform.rb +9 -2
  65. data/lib/cisco_node_utils/router_ospf.rb +1 -1
  66. data/lib/cisco_node_utils/router_ospf_area.rb +416 -0
  67. data/lib/cisco_node_utils/router_ospf_area_vlink.rb +313 -0
  68. data/lib/cisco_node_utils/router_ospf_vrf.rb +17 -0
  69. data/lib/cisco_node_utils/snmp_notification_receiver.rb +27 -9
  70. data/lib/cisco_node_utils/snmpcommunity.rb +34 -8
  71. data/lib/cisco_node_utils/snmpserver.rb +4 -4
  72. data/lib/cisco_node_utils/snmpuser.rb +0 -0
  73. data/lib/cisco_node_utils/tacacs_global.rb +102 -0
  74. data/lib/cisco_node_utils/tacacs_server.rb +8 -7
  75. data/lib/cisco_node_utils/vdc.rb +25 -7
  76. data/lib/cisco_node_utils/version.rb +1 -1
  77. data/lib/cisco_node_utils/vlan.rb +30 -56
  78. data/lib/cisco_node_utils/vlan_DEPRECATED.rb +108 -0
  79. data/lib/cisco_node_utils/yang.rb +160 -0
  80. data/lib/cisco_node_utils/yum.rb +25 -32
  81. data/tests/.rubocop.yml +3 -0
  82. data/tests/ciscotest.rb +136 -19
  83. data/tests/cmd_config_invalid.yaml +1 -1
  84. data/tests/noop.rb +7 -0
  85. data/tests/tacacs_server.yaml.example +6 -0
  86. data/tests/test_aaa_authentication_login.rb +24 -1
  87. data/tests/test_aaa_authentication_login_service.rb +9 -16
  88. data/tests/test_aaa_authorization_service.rb +111 -84
  89. data/tests/test_bfd_global.rb +278 -0
  90. data/tests/test_bgp_neighbor.rb +20 -0
  91. data/tests/test_bridge_domain_vni.rb +2 -9
  92. data/tests/test_cmn_utils.rb +76 -0
  93. data/tests/test_dhcp_relay_global.rb +284 -0
  94. data/tests/test_dns_domain.rb +4 -4
  95. data/tests/test_domain_name.rb +2 -2
  96. data/tests/test_encapsulation.rb +2 -4
  97. data/tests/test_evpn_vni.rb +14 -7
  98. data/tests/test_fabricpath_global.rb +12 -13
  99. data/tests/test_feature.rb +35 -17
  100. data/tests/test_interface.rb +352 -127
  101. data/tests/test_interface_bdi.rb +2 -2
  102. data/tests/test_interface_channel_group.rb +1 -1
  103. data/tests/test_interface_ospf.rb +153 -23
  104. data/tests/test_interface_portchannel.rb +15 -6
  105. data/tests/test_interface_private_vlan.rb +200 -576
  106. data/tests/test_interface_svi.rb +5 -52
  107. data/tests/test_interface_switchport.rb +80 -240
  108. data/tests/test_itd_device_group.rb +2 -2
  109. data/tests/test_itd_device_group_node.rb +2 -2
  110. data/tests/test_itd_service.rb +1 -1
  111. data/tests/test_name_server.rb +3 -3
  112. data/tests/test_node_ext.rb +15 -17
  113. data/tests/test_ntp_config.rb +1 -1
  114. data/tests/test_ntp_server.rb +3 -3
  115. data/tests/test_nxapi.rb +1 -0
  116. data/tests/test_overlay_global.rb +15 -19
  117. data/tests/test_pim.rb +5 -5
  118. data/tests/test_pim_group_list.rb +1 -37
  119. data/tests/test_pim_rp_address.rb +1 -1
  120. data/tests/test_platform.rb +9 -11
  121. data/tests/test_portchannel_global.rb +43 -3
  122. data/tests/test_radius_server.rb +1 -1
  123. data/tests/test_radius_server_group.rb +1 -1
  124. data/tests/test_router_bgp.rb +17 -30
  125. data/tests/test_router_ospf_area.rb +433 -0
  126. data/tests/test_router_ospf_area_vlink.rb +298 -0
  127. data/tests/test_router_ospf_vrf.rb +17 -0
  128. data/tests/test_snmp_notification_receiver.rb +11 -11
  129. data/tests/test_snmpcommunity.rb +177 -69
  130. data/tests/test_snmpgroup.rb +7 -7
  131. data/tests/test_snmpserver.rb +164 -253
  132. data/tests/test_snmpuser.rb +73 -69
  133. data/tests/test_stp_global.rb +15 -15
  134. data/tests/test_syslog_settings.rb +1 -1
  135. data/tests/test_tacacs_global.rb +80 -0
  136. data/tests/test_tacacs_server.rb +129 -51
  137. data/tests/test_tacacs_server_group.rb +3 -29
  138. data/tests/test_tacacs_server_host.rb +24 -27
  139. data/tests/test_vlan.rb +57 -59
  140. data/tests/test_vlan_private.rb +271 -284
  141. data/tests/test_vpc.rb +10 -4
  142. data/tests/test_vrf.rb +2 -0
  143. data/tests/test_vrf_af.rb +2 -5
  144. data/tests/test_vtp.rb +5 -2
  145. data/tests/test_vxlan_vtep.rb +20 -44
  146. data/tests/test_vxlan_vtep_vni.rb +23 -16
  147. data/tests/test_yang.rb +369 -0
  148. data/tests/test_yum.rb +34 -42
  149. data/tests/yum_package.yaml +35 -0
  150. metadata +31 -4
  151. data/tests/test_vlan_mt_full.rb +0 -85
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.description = <<-EOF
15
15
  Utilities for management of Cisco network nodes.
16
16
  Designed to work with Puppet and Chef.
17
- Currently supports NX-OS and IOS XR nodes.
17
+ Currently supports NX-OS nodes.
18
18
  EOF
19
19
  spec.license = 'Apache-2.0'
20
20
  spec.homepage = 'https://github.com/cisco/cisco-network-node-utils'
@@ -48,6 +48,7 @@ When we are considering publishing a new release, all of the following steps mus
48
48
  - N56xx
49
49
  - N6xxx
50
50
  - N7xxx
51
+ - N8xxx
51
52
  - N9xxx
52
53
 
53
54
  3. Triage any minitest failures.
@@ -0,0 +1,14 @@
1
+ # Executable utilities included in this gem
2
+
3
+ ## check_metric_limits.rb
4
+
5
+ This is a helper script for developers. If you're doing refactoring work to
6
+ reduce the code complexity metrics, you can run this script to report the
7
+ worst offenders for each metric and whether you've managed to improve any
8
+ metrics compared to the baseline. Run this script from the base
9
+ cisco-network-node-utils directory to report metrics of code in the
10
+ ./lib and ./tests directories.
11
+
12
+ ```bash
13
+ [cisco-network-node-utils]$ ruby bin/check_metric_limits.rb
14
+ ```
data/lib/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ Metrics/MethodLength:
12
12
  Max: 50
13
13
 
14
14
  Metrics/ParameterLists:
15
- Max: 9
15
+ Max: 10
16
16
 
17
17
  Metrics/PerceivedComplexity:
18
18
  Max: 24
@@ -57,9 +57,14 @@ module Cisco
57
57
 
58
58
  if g_str.empty?
59
59
  # cannot remove default local, so do nothing in this case
60
- unless m == :local && @name == 'default'
61
- config_set('aaa_auth_login_service', 'method',
62
- 'no', @name, m_str)
60
+ unless m == :local
61
+ unless node.product_id[/N8/]
62
+ # TBD: These 'no' commands currently error on N8k
63
+ # no aaa authentication login console local
64
+ # no aaa authentication login console none
65
+ config_set('aaa_auth_login_service', 'method',
66
+ 'no', @name, m_str)
67
+ end
63
68
  end
64
69
  else
65
70
  config_set('aaa_auth_login_service', 'groups',
@@ -39,6 +39,10 @@ module Cisco
39
39
  config_set('aaa_authorization_service', 'method', '', type_str, name)
40
40
  end
41
41
 
42
+ def self.remove_local_auth
43
+ config_get('aaa_authorization_service', 'remove_local_auth')
44
+ end
45
+
42
46
  def self.services
43
47
  servs = {}
44
48
  servs_arr = config_get('aaa_authorization_service', 'services')
@@ -66,6 +70,8 @@ module Cisco
66
70
  'no', t_str, @name)
67
71
  end
68
72
  else
73
+ # Removal of auth method local is not supported on all platforms.
74
+ m_str = AaaAuthorizationService.remove_local_auth ? m_str : ''
69
75
  config_set('aaa_authorization_service', 'groups',
70
76
  'no', t_str, @name, g_str, m_str)
71
77
  end
@@ -0,0 +1,300 @@
1
+ #
2
+ # NXAPI implementation of BFD Global class
3
+ #
4
+ # May 2016, Sai Chintalapudi
5
+ #
6
+ # Copyright (c) 2016 Cisco and/or its affiliates.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ require_relative 'node_util'
21
+
22
+ module Cisco
23
+ # node_utils class for bfd_global
24
+ class BfdGlobal < NodeUtil
25
+ attr_reader :name
26
+
27
+ def initialize(instantiate=true)
28
+ set_args_keys_default
29
+
30
+ Feature.bfd_enable if instantiate
31
+ end
32
+
33
+ # Reset everything back to default
34
+ def destroy
35
+ return unless Feature.bfd_enabled?
36
+ [:interval,
37
+ :ipv4_interval,
38
+ :ipv6_interval,
39
+ :fabricpath_interval,
40
+ :echo_interface,
41
+ :echo_rx_interval,
42
+ :ipv4_echo_rx_interval,
43
+ :ipv6_echo_rx_interval,
44
+ :fabricpath_vlan,
45
+ :slow_timer,
46
+ :ipv4_slow_timer,
47
+ :ipv6_slow_timer,
48
+ :fabricpath_slow_timer,
49
+ :startup_timer,
50
+ ].each do |prop|
51
+ send("#{prop}=", send("default_#{prop}")) if
52
+ send prop
53
+ end
54
+ set_args_keys_default
55
+ end
56
+
57
+ # Helper method to delete @set_args hash keys
58
+ def set_args_keys_default
59
+ keys = { state: '' }
60
+ @get_args = @set_args = keys
61
+ end
62
+
63
+ # rubocop:disable Style/AccessorMethodName
64
+ def set_args_keys(hash={})
65
+ set_args_keys_default
66
+ @set_args = @get_args.merge!(hash) unless hash.empty?
67
+ end
68
+
69
+ ########################################################
70
+ # PROPERTIES #
71
+ ########################################################
72
+
73
+ def echo_interface
74
+ config_get('bfd_global', 'echo_interface', @get_args)
75
+ end
76
+
77
+ def echo_interface=(val)
78
+ set_args_keys(intf: val ? val : echo_interface,
79
+ state: val ? '' : 'no')
80
+ config_set('bfd_global', 'echo_interface', @set_args) if
81
+ @set_args[:intf]
82
+ end
83
+
84
+ def default_echo_interface
85
+ config_get_default('bfd_global', 'echo_interface')
86
+ end
87
+
88
+ def echo_rx_interval
89
+ config_get('bfd_global', 'echo_rx_interval', @get_args)
90
+ end
91
+
92
+ def echo_rx_interval=(val)
93
+ set_args_keys(rxi: val,
94
+ state: val == default_echo_rx_interval ? 'no' : '')
95
+ config_set('bfd_global', 'echo_rx_interval', @set_args)
96
+ end
97
+
98
+ def default_echo_rx_interval
99
+ config_get_default('bfd_global', 'echo_rx_interval')
100
+ end
101
+
102
+ def ipv4_echo_rx_interval
103
+ config_get('bfd_global', 'ipv4_echo_rx_interval', @get_args)
104
+ end
105
+
106
+ def ipv4_echo_rx_interval=(val)
107
+ set_args_keys(rxi: val,
108
+ state: val == default_ipv4_echo_rx_interval ? 'no' : '')
109
+ config_set('bfd_global', 'ipv4_echo_rx_interval', @set_args)
110
+ end
111
+
112
+ def default_ipv4_echo_rx_interval
113
+ config_get_default('bfd_global', 'ipv4_echo_rx_interval')
114
+ end
115
+
116
+ def ipv6_echo_rx_interval
117
+ config_get('bfd_global', 'ipv6_echo_rx_interval', @get_args)
118
+ end
119
+
120
+ def ipv6_echo_rx_interval=(val)
121
+ set_args_keys(rxi: val,
122
+ state: val == default_ipv6_echo_rx_interval ? 'no' : '')
123
+ config_set('bfd_global', 'ipv6_echo_rx_interval', @set_args)
124
+ end
125
+
126
+ def default_ipv6_echo_rx_interval
127
+ config_get_default('bfd_global', 'ipv6_echo_rx_interval')
128
+ end
129
+
130
+ def slow_timer
131
+ config_get('bfd_global', 'slow_timer', @get_args)
132
+ end
133
+
134
+ def slow_timer=(val)
135
+ set_args_keys(timer: val,
136
+ state: val == default_slow_timer ? 'no' : '')
137
+ config_set('bfd_global', 'slow_timer', @set_args)
138
+ end
139
+
140
+ def default_slow_timer
141
+ config_get_default('bfd_global', 'slow_timer')
142
+ end
143
+
144
+ def ipv4_slow_timer
145
+ config_get('bfd_global', 'ipv4_slow_timer', @get_args)
146
+ end
147
+
148
+ def ipv4_slow_timer=(val)
149
+ set_args_keys(timer: val,
150
+ state: val == default_ipv4_slow_timer ? 'no' : '')
151
+ config_set('bfd_global', 'ipv4_slow_timer', @set_args)
152
+ end
153
+
154
+ def default_ipv4_slow_timer
155
+ config_get_default('bfd_global', 'ipv4_slow_timer')
156
+ end
157
+
158
+ def ipv6_slow_timer
159
+ config_get('bfd_global', 'ipv6_slow_timer', @get_args)
160
+ end
161
+
162
+ def ipv6_slow_timer=(val)
163
+ set_args_keys(timer: val,
164
+ state: val == default_ipv6_slow_timer ? 'no' : '')
165
+ config_set('bfd_global', 'ipv6_slow_timer', @set_args)
166
+ end
167
+
168
+ def default_ipv6_slow_timer
169
+ config_get_default('bfd_global', 'ipv6_slow_timer')
170
+ end
171
+
172
+ def fabricpath_slow_timer
173
+ config_get('bfd_global', 'fabricpath_slow_timer', @get_args)
174
+ end
175
+
176
+ def fabricpath_slow_timer=(val)
177
+ set_args_keys(timer: val,
178
+ state: val == default_fabricpath_slow_timer ? 'no' : '')
179
+ config_set('bfd_global', 'fabricpath_slow_timer', @set_args)
180
+ end
181
+
182
+ def default_fabricpath_slow_timer
183
+ config_get_default('bfd_global', 'fabricpath_slow_timer')
184
+ end
185
+
186
+ def startup_timer
187
+ config_get('bfd_global', 'startup_timer', @get_args)
188
+ end
189
+
190
+ def startup_timer=(val)
191
+ set_args_keys(timer: val,
192
+ state: val == default_startup_timer ? 'no' : '')
193
+ config_set('bfd_global', 'startup_timer', @set_args)
194
+ end
195
+
196
+ def default_startup_timer
197
+ config_get_default('bfd_global', 'startup_timer')
198
+ end
199
+
200
+ def fabricpath_vlan
201
+ config_get('bfd_global', 'fabricpath_vlan', @get_args)
202
+ end
203
+
204
+ def fabricpath_vlan=(val)
205
+ set_args_keys(vlan: val,
206
+ state: val == default_fabricpath_vlan ? 'no' : '')
207
+ config_set('bfd_global', 'fabricpath_vlan', @set_args)
208
+ end
209
+
210
+ def default_fabricpath_vlan
211
+ config_get_default('bfd_global', 'fabricpath_vlan')
212
+ end
213
+
214
+ def default_interval
215
+ config_get_default('bfd_global', 'interval')
216
+ end
217
+
218
+ def default_ipv4_interval
219
+ config_get_default('bfd_global', 'ipv4_interval')
220
+ end
221
+
222
+ def default_ipv6_interval
223
+ config_get_default('bfd_global', 'ipv6_interval')
224
+ end
225
+
226
+ def default_fabricpath_interval
227
+ config_get_default('bfd_global', 'fabricpath_interval')
228
+ end
229
+
230
+ # interval is an array of interval, min_rx and multiplier
231
+ # CLI: bfd interval 100 min_rx 100 multiplier 25
232
+ def interval
233
+ config_get('bfd_global', 'interval', @get_args)
234
+ end
235
+
236
+ # ipv4_interval is an array of ipv4_interval, ipv4_min_rx and
237
+ # ipv4_multiplier
238
+ # CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25
239
+ def ipv4_interval
240
+ config_get('bfd_global', 'ipv4_interval', @get_args)
241
+ end
242
+
243
+ # ipv6_interval is an array of ipv6_interval, ipv6_min_rx and
244
+ # ipv6_multiplier
245
+ # CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25
246
+ def ipv6_interval
247
+ config_get('bfd_global', 'ipv6_interval', @get_args)
248
+ end
249
+
250
+ # fabricpath_interval is an array of fabricpath_interval,
251
+ # fabricpath_min_rx and fabricpath_multiplier
252
+ # CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25
253
+ def fabricpath_interval
254
+ config_get('bfd_global', 'fabricpath_interval', @get_args)
255
+ end
256
+
257
+ # interval is an array of interval, min_rx and multiplier
258
+ # ex: ['100', '100', '25']
259
+ # CLI: bfd interval 100 min_rx 100 multiplier 25
260
+ def interval=(arr)
261
+ interval, min_rx, multiplier = arr
262
+ set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
263
+ state: arr == default_interval ? 'no' : '')
264
+ config_set('bfd_global', 'interval', @set_args)
265
+ end
266
+
267
+ # ipv4_interval is an array of ipv4_interval, ipv4_min_rx and
268
+ # ipv4_multiplier
269
+ # ex: ['100', '100', '25']
270
+ # CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25
271
+ def ipv4_interval=(arr)
272
+ interval, min_rx, multiplier = arr
273
+ set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
274
+ state: arr == default_ipv4_interval ? 'no' : '')
275
+ config_set('bfd_global', 'ipv4_interval', @set_args)
276
+ end
277
+
278
+ # ipv6_interval is an array of ipv6_interval, ipv6_min_rx and
279
+ # ipv6_multiplier
280
+ # ex: ['100', '100', '25']
281
+ # CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25
282
+ def ipv6_interval=(arr)
283
+ interval, min_rx, multiplier = arr
284
+ set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
285
+ state: arr == default_ipv6_interval ? 'no' : '')
286
+ config_set('bfd_global', 'ipv6_interval', @set_args)
287
+ end
288
+
289
+ # fabricpath_interval is an array of fabricpath_interval,
290
+ # fabricpath_min_rx and fabricpath_multiplier
291
+ # ex: ['100', '100', '25']
292
+ # CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25
293
+ def fabricpath_interval=(arr)
294
+ interval, min_rx, multiplier = arr
295
+ set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
296
+ state: arr == default_fabricpath_interval ? 'no' : '')
297
+ config_set('bfd_global', 'fabricpath_interval', @set_args)
298
+ end
299
+ end # class
300
+ end # module
@@ -100,7 +100,7 @@ module Cisco
100
100
  end
101
101
 
102
102
  def wait_for_process_initialized
103
- return unless node.product_id[/N(5|6)/]
103
+ return unless node.product_id[/N(5|6|8)/]
104
104
 
105
105
  # Hack for slow-start platforms which will have setter failures if the
106
106
  # bgp instance is still initializing. To see this problem in a sandbox
@@ -462,7 +462,7 @@ module Cisco
462
462
  def event_history_events
463
463
  match = config_get('bgp', 'event_history_events', @get_args)
464
464
  if match.is_a?(Array)
465
- return 'false' if match[0] == 'no '
465
+ return 'size_disable' if match[0] == 'no '
466
466
  return 'size_' + match[1] if match[1]
467
467
  end
468
468
  default_event_history_events
@@ -805,7 +805,8 @@ module Cisco
805
805
  # N3k I2 images require 'nv overlay evpn' for rd and also require
806
806
  # explicit values when removing the rd command. These restrictions are
807
807
  # not not needed in I3 and newer images.
808
- Feature.nv_overlay_evpn_enable if Utils.nexus_i2_image
808
+ Feature.nv_overlay_evpn_enable if
809
+ Utils.nexus_i2_image || node.product_id[/N7/]
809
810
 
810
811
  if rd == default_route_distinguisher
811
812
  return if route_distinguisher.empty?
@@ -867,7 +868,8 @@ module Cisco
867
868
 
868
869
  # Supress Fib Pending (Getter/Setter/Default)
869
870
  def suppress_fib_pending
870
- config_get('bgp', 'suppress_fib_pending', @get_args)
871
+ val = config_get('bgp', 'suppress_fib_pending', @get_args)
872
+ val.nil? ? false : val
871
873
  end
872
874
 
873
875
  def suppress_fib_pending=(enable)
@@ -29,6 +29,8 @@ module Cisco
29
29
  err_msg = '"af" argument must be an array of two string values ' \
30
30
  'containing an afi + safi tuple'
31
31
  fail ArgumentError, err_msg unless af.is_a?(Array) || af.length == 2
32
+ err_msg = '"vrf" argument must be "default" for l2vpn address-family'
33
+ fail ArgumentError, err_msg if vrf != 'default' && af[1][/evpn/]
32
34
  @asn = RouterBgp.validate_asnum(asn)
33
35
  @vrf = vrf
34
36
  @afi, @safi = af
@@ -88,6 +88,20 @@ module Cisco
88
88
  @set_args = @set_args.merge!(hash) unless hash.empty?
89
89
  end
90
90
 
91
+ def bfd=(val)
92
+ set_args_keys(state: (val) ? '' : 'no')
93
+ Feature.bfd_enable
94
+ config_set('bgp_neighbor', 'bfd', @set_args)
95
+ end
96
+
97
+ def bfd
98
+ config_get('bgp_neighbor', 'bfd', @get_args)
99
+ end
100
+
101
+ def default_bfd
102
+ config_get_default('bgp_neighbor', 'bfd')
103
+ end
104
+
91
105
  def description=(desc)
92
106
  fail TypeError unless desc.is_a?(String)
93
107
  desc.strip!