Method: Cisco::RouteMap#set_extcommunity_cost_pre_bestpath

Defined in:
lib/cisco_node_utils/route_map.rb

#set_extcommunity_cost_pre_bestpathObject



2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
# File 'lib/cisco_node_utils/route_map.rb', line 2444

def set_extcommunity_cost_pre_bestpath
  str = config_get('route_map', 'set_extcommunity_cost', @get_args)
  return default_set_extcommunity_cost_pre_bestpath if
    str.nil? || !str.include?('pre-bestpath')
  arr = str.split
  ret_arr = []
  index = arr.index('pre-bestpath')
  while index
    larr = []
    larr << arr[index + 1]
    larr << arr[index + 2]
    ret_arr << larr
    arr.delete_at(index)
    arr.delete_at(index)
    arr.delete_at(index)
    index = arr.index('pre-bestpath')
  end
  ret_arr
end