summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-06 16:16:18 -0700
committerTim Smith <tsmith@chef.io>2017-09-06 16:16:18 -0700
commite58a84b69008091224f66fd153e93625ccd6f289 (patch)
treee214507e6e51188a9e9f44aa0de4ab770e3bdb4d
parentc8ca74e5d8767dbdcd3afb01336df166dac449e1 (diff)
downloadohai-e58a84b69008091224f66fd153e93625ccd6f289.tar.gz
Remove the org detection since it's less reliable that UUID
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/ec2.rb17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/ohai/plugins/ec2.rb b/lib/ohai/plugins/ec2.rb
index 1a7d5553..c2666488 100644
--- a/lib/ohai/plugins/ec2.rb
+++ b/lib/ohai/plugins/ec2.rb
@@ -35,7 +35,6 @@ Ohai.plugin(:EC2) do
provides "ec2"
depends "dmi"
- depends "kernel"
# look for amazon string in dmi bios data
# this gets us detection of HVM instances that are within a VPC
@@ -73,27 +72,13 @@ Ohai.plugin(:EC2) do
false
end
- # looks for the Amazon.com Organization in Windows Kernel data
- # this gets us detection of Windows systems
- # @return [Boolean] is the Windows organization Amazon?
- def has_amazon_org?
- # detect an Organization of 'Amazon.com'
- if get_attribute(:kernel, :os_info, :organization) =~ /Amazon/
- Ohai::Log.debug("Plugin EC2: has_amazon_org? == true")
- true
- else
- Ohai::Log.debug("Plugin EC2: has_amazon_org? == false")
- false
- end
- end
-
# a single check that combines all the various detection methods for EC2
# @return [Boolean] Does the system appear to be on EC2
def looks_like_ec2?
return true if hint?("ec2")
# Even if it looks like EC2 try to connect first
- if has_ec2_xen_uuid? || has_ec2_dmi? || has_amazon_org?
+ if has_ec2_xen_uuid? || has_ec2_dmi?
return true if can_socket_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
end
end