def set_extcommunity_cost_set(igp, pre)
      str = ''
      # reset first
      if set_extcommunity_cost_device
        cpre = set_extcommunity_cost_pre_bestpath
        cigp = set_extcommunity_cost_igp
        cpre.each do |id, val|
          str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
        end
        cigp.each do |id, val|
          str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
        end
      end
      set_args_keys(state: 'no', string: str)
      config_set('route_map', 'set_extcommunity_cost', @set_args)
      return if igp.empty? && pre.empty?
      str = ''
      pre.each do |id, val|
        str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
      end
      igp.each do |id, val|
        str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
      end
      set_args_keys(state: '', string: str)
      config_set('route_map', 'set_extcommunity_cost', @set_args)
    end
def set_extcommunity_cost_set(igp, pre)
      str = ''
      # reset first
      if set_extcommunity_cost_device
        cpre = set_extcommunity_cost_pre_bestpath
        cigp = set_extcommunity_cost_igp
        cpre.each do |id, val|
          str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
        end
        cigp.each do |id, val|
          str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
        end
      end
      set_args_keys(state: 'no', string: str)
      config_set('route_map', 'set_extcommunity_cost', @set_args)
      return if igp.empty? && pre.empty?
      str = ''
      pre.each do |id, val|
        str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
      end
      igp.each do |id, val|
        str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
      end
      set_args_keys(state: '', string: str)
      config_set('route_map', 'set_extcommunity_cost', @set_args)
    end
set extcommunity cost igp 0 22 igp 3 23
 set extcommunity cost pre-bestpath 1 222 pre-bestpath 2 54
 set extcommunity cost pre-bestpath 1 222 pre-bestpath 2 54 igp 0 22