Method: Cisco::RouterBgpAF#redistribute=
- Defined in:
- lib/cisco_node_utils/bgp_af.rb
#redistribute=(should) ⇒ Object
redistribute setter. Process a hash of redistribute commands from delta_add_remove().
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/cisco_node_utils/bgp_af.rb', line 460 def redistribute=(should) delta_hash = Utils.delta_add_remove(should, redistribute) return if delta_hash.values.flatten.empty? [:add, :remove].each do |action| Cisco::Logger.debug("redistribute delta #{@get_args}\n #{action}: " \ "#{delta_hash[action]}") delta_hash[action].each do |protocol, policy| state = (action == :add) ? '' : 'no' set_args_keys(state: state, protocol: protocol, policy: policy) # route-map/policy may be optional on some platforms cmd = policy.nil? ? 'redistribute' : 'redistribute_policy' config_set('bgp_af', cmd, @set_args) end end end |