Class: Facts::Linux::Ec2Metadata
- Inherits:
-
Object
- Object
- Facts::Linux::Ec2Metadata
- Defined in:
- lib/facter/facts/linux/ec2_metadata.rb
Constant Summary collapse
- FACT_NAME =
'ec2_metadata'
Instance Method Summary collapse
- #call_the_resolver ⇒ Object
-
#initialize ⇒ Ec2Metadata
constructor
A new instance of Ec2Metadata.
Constructor Details
#initialize ⇒ Ec2Metadata
Returns a new instance of Ec2Metadata.
8 9 10 |
# File 'lib/facter/facts/linux/ec2_metadata.rb', line 8 def initialize @virtual = Facter::Util::Facts::VirtualDetector.new end |
Instance Method Details
#call_the_resolver ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/facter/facts/linux/ec2_metadata.rb', line 12 def call_the_resolver return Facter::ResolvedFact.new(FACT_NAME, nil) unless aws_hypervisors? fact_value = Facter::Resolvers::Ec2.resolve(:metadata) Facter::ResolvedFact.new(FACT_NAME, fact_value&.empty? ? nil : fact_value) end |