lib/wmap/host_tracker.rb
# Setter to add host entry to the local hosts in batch (from an array)
Setter to add host entry to the local hosts in batch (from an array)
Setter to add host entry to the local hosts in batch ( from an array )
def bulk_add(list, num=@max_parallel)
		puts "Add entries to the local host repository: #{list}"
		results=Hash.new
		if list.size > 0
			puts "Start parallel host update processing on:\n #{list}" if @verbose
			Parallel.map(list, :in_processes => num) { |target|
				add(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
				else
					results.merge!(process)
				end
			end
			@known_hosts.merge!(results)
			puts "Done loading host entries."
			return results
		else
			puts "Error: empty list - no entry is loaded. Please check your input list and try again."
		end
		return results
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}"
	end
def bulk_add ( list , num = @max_parallel ) puts "Add entries to the local host repository: #{list}" results = Hash . new if list . size > 0 puts "Start parallel host update processing on:\n #{list}" if @verbose Parallel . map ( list , :in_processes => num ) { | target | add ( target ) } . each do | process | if process . nil? next elsif process . empty? else results . merge! ( process ) end end @known_hosts . merge! ( results ) puts "Done loading host entries." return results else puts "Error: empty list - no entry is loaded. Please check your input list and try again." end return results rescue => ee puts "Exception on method #{__method__}: #{ee}" end
Setter to add host entry to the local hosts in batch (from an array)
Setter to add host entry to the local hosts in batch ( from an array )
#do nothing
list
<not_specific>
num
<not_specific>