lib/gogetit/util.rb in gogetit-0.13.3 vs lib/gogetit/util.rb in gogetit-0.13.4
- old
+ new
@@ -167,11 +167,11 @@
end
end
end
def wait_until_available(ip_or_fqdn, distro_name)
- logger.info("Calling <#{__method__.to_s}>")
+ logger.info("Calling <#{__method__.to_s}> for network connection..")
until ping_available?(ip_or_fqdn)
logger.info("Calling <#{__method__.to_s}> for ping to be ready..")
sleep 3
end
logger.info("#{ip_or_fqdn} is now available to ping..")
@@ -189,15 +189,17 @@
`ping -c 1 -W 1 #{host}`
$?.exitstatus == 0
end
def ssh_available?(ip_or_fqdn, user)
- logger.info("Calling <#{__method__.to_s}>")
+ logger.info("Calling <#{__method__.to_s}> for #{user}@#{ip_or_fqdn}")
begin
- Net::SSH.start(ip_or_fqdn, user).class
+ Net::SSH.start(ip_or_fqdn, user)
rescue Exception => e
puts e
+ false
end
+ true
end
def check_ip_available(addresses, maas)
logger.info("Calling <#{__method__.to_s}>")
# to do a ping test