Method: Cisco::RouteMap#match_ext_community_set

Defined in:
lib/cisco_node_utils/route_map.rb

#match_ext_community_set(list, exact) ⇒ Object



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/cisco_node_utils/route_map.rb', line 213

def match_ext_community_set(list, exact)
  carr = match_ext_community
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', comm: cstr)
    # reset the current config
    config_set('route_map', 'match_ext_community', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  nstr.concat('exact-match') if exact
  set_args_keys(state: '', comm: nstr)
  config_set('route_map', 'match_ext_community', @set_args)
end