lib/wmap/host_tracker.rb
# Search local host repository and return a list of aliases for the host
Search local host repository and return a list of aliases for the host
Search local host repository and return a list of aliases for the host
def host_aliases (host)
		puts "Search aliases in the local hosts data repository for host: #{host}" if @verbose
		host.strip!
		raise "Unknown method input: #{host} We expect a FQDN host-name string from you. " unless is_fqdn?(host)
		aliases=Array.new
		if @known_hosts.key?(host)
			ip=local_host_2_ip(host)
			@known_hosts.keys.map do |key|
				my_ip=local_host_2_ip(key)
				if ip == my_ip
					aliases.push(key)
				end
			end
		else
			raise "Unknown host-name in the local hosts data repository: #{host}"
		end
		return aliases-[host]
	rescue Exception => ee
		puts "Exception on method #{__method__}: #{ee}"
		return nil
	end
def host_aliases ( host ) puts "Search aliases in the local hosts data repository for host: #{host}" if @verbose host . strip! raise "Unknown method input: #{host} We expect a FQDN host-name string from you. " unless is_fqdn? ( host ) aliases = Array . new if @known_hosts . key? ( host ) ip = local_host_2_ip ( host ) @known_hosts . keys . map do | key | my_ip = local_host_2_ip ( key ) if ip == my_ip aliases . push ( key ) end end else raise "Unknown host-name in the local hosts data repository: #{host}" end return aliases - [ host ] rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" return nil end
Search local host repository and return a list of aliases for the host
Search local host repository and return a list of aliases for the host
host
<not_specific>