Method: Cisco::RouteMap#set_ipv4_next_hop_set

Defined in:
lib/cisco_node_utils/route_map.rb

#set_ipv4_next_hop_set(list, share = false) ⇒ Object



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
# File 'lib/cisco_node_utils/route_map.rb', line 1936

def set_ipv4_next_hop_set(list, share=false)
  carr = set_ipv4_next_hop
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  cstr.concat('load-share') unless default_set_ipv4_next_hop_load_share.nil?
  set_args_keys(state: 'no', nh: cstr)
  # reset the current config
  config_set('route_map', 'set_ipv4_next_hop', @set_args) unless
    cstr.empty?
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  nstr.concat('load-share') if share
  return if nstr.empty?
  set_args_keys(state: '', nh: nstr)
  config_set('route_map', 'set_ipv4_next_hop', @set_args)
end