diff options
author | Tim Smith <tsmith@llnw.com> | 2013-01-24 11:11:24 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-06-23 21:57:29 -0700 |
commit | 3da17c1df38afed60c5634d9113a175b00d450a6 (patch) | |
tree | 58bbea223b41a7ecfaa909584f16e9696010ee19 | |
parent | a8711196d58944599e4bf5619f74f6115be89664 (diff) | |
download | ohai-3da17c1df38afed60c5634d9113a175b00d450a6.tar.gz |
Mac address based identifier for Rackspace falsely identifies systems on Cisco
This causes a lot of problems in cookbooks that try to use the private
IP if the equipment is on rackspace. They end up failing if there is
no eth1 on your hardware/VMs connected to Cisco networking equipment.
-rw-r--r-- | lib/ohai/plugins/rackspace.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb index 93c4ff5e..5f86866f 100644 --- a/lib/ohai/plugins/rackspace.rb +++ b/lib/ohai/plugins/rackspace.rb @@ -28,20 +28,6 @@ def has_rackspace_kernel? kernel[:release].split('-').last.eql?("rscloud") end -# Checks for matching rackspace arp mac -# -# === Return -# true:: If mac address matches -# false:: Otherwise -def has_rackspace_mac? - network[:interfaces].values.each do |iface| - unless iface[:arp].nil? - return true if iface[:arp].value?("00:00:0c:07:ac:01") or iface[:arp].value?("00:00:0c:9f:f0:01") - end - end - false -end - # Checks for rackspace provider attribute # # === Return @@ -62,7 +48,7 @@ end # true:: If the rackspace cloud can be identified # false:: Otherwise def looks_like_rackspace? - hint?('rackspace') || has_rackspace_metadata? || has_rackspace_mac? || has_rackspace_kernel? + hint?('rackspace') || has_rackspace_metadata? || has_rackspace_kernel? end # Names rackspace ip address @@ -73,7 +59,7 @@ end def get_ip_address(name, eth) network[:interfaces][eth][:addresses].each do |key, info| if info['family'] == 'inet' - rackspace[name] = key + rackspace[name] = key break # break when we found an address end end @@ -88,7 +74,7 @@ def get_global_ipv6_address(name, eth) network[:interfaces][eth][:addresses].each do |key, info| # check if we got an ipv6 address and if its in global scope if info['family'] == 'inet6' && info['scope'] == 'Global' - rackspace[name] = key + rackspace[name] = key break # break when we found an address end end |