diff options
author | Daniel Wallace <danielwallace@gtmanfred.com> | 2013-10-17 15:26:59 -0500 |
---|---|---|
committer | Daniel Wallace <danielwallace@gtmanfred.com> | 2013-10-18 13:56:21 -0500 |
commit | edd8e3c1ea34f4cb8c723eee2fda958f521efbe5 (patch) | |
tree | 8529a968253639f0fc64767db45ced26f661081c | |
parent | 7a87dcdb0ee61f66ef70e1ad0d943d774f360b6d (diff) | |
download | ohai-edd8e3c1ea34f4cb8c723eee2fda958f521efbe5.tar.gz |
remove *.static.cloud-ips.com
Rackspace no longer sets the reverse dns for cloud servers as the spin
up.
https://community.rackspace.com/general/f/34/t/623
-rw-r--r-- | lib/ohai/plugins/rackspace.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb index b96ebdf9..56bd3267 100644 --- a/lib/ohai/plugins/rackspace.rb +++ b/lib/ohai/plugins/rackspace.rb @@ -94,6 +94,7 @@ Ohai.plugin(:Rackspace) do end collect_data do + require "resolv" # Adds rackspace Mash if looks_like_rackspace? rackspace Mash.new @@ -104,7 +105,11 @@ Ohai.plugin(:Rackspace) do rackspace[:public_ipv4] = rackspace[:public_ip] get_global_ipv6_address(:public_ipv6, :eth0) unless rackspace[:public_ip].nil? - rackspace[:public_hostname] = "#{rackspace[:public_ip].gsub('.','-')}.static.cloud-ips.com" + rackspace[:public_hostname] = begin + Resolv.getname(rackspace[:public_ip]) + rescue SocketError + rackspace[:public_ip] + end end rackspace[:local_ipv4] = rackspace[:private_ip] get_global_ipv6_address(:local_ipv6, :eth1) |