Comment 3 for bug 885998

Revision history for this message
David Brewer (david-brewer) wrote :

I just ran into this issue this afternoon on my own servers. The issue is definitely related to the ec2.rb changes in facter 1.5.6-2ubuntu2.2. As a temporary hack/workaround I was able to get Puppet working again by manually editing /usr/lib/ruby/1.8/facter/ec2.rb and reverting the "can_connect?" method to use the code for that method defined in the previous version of the page. Specifically, see below the commented "new" version of the method and my inserted "old" version of the method.

# This version of the method causes timeouts even if your machine is not using EC2
#def can_connect?(ip,port,wait_sec=2)
# url = "http://#{ip}:#{port}"
# Timeout::timeout(wait_sec) {open(url)}
# return true
#rescue
# return false
#end

# This version of the method seems to work, although I can't guarantee it works with EC2
# as my servers are not running there
def can_connect?(ip,port,wait_sec=2)
 Timeout::timeout(wait_sec) {open(ip, port)}
 return true
rescue
  return false
end