summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-01-25 16:51:10 -0800
committerTim Smith <tsmith84@gmail.com>2021-01-25 16:51:10 -0800
commit6579776fab7ae3b089002bc8e059c1b63cdcab20 (patch)
tree46ca6b93bca037ecbec91b337e454df064ae2f70
parent710fad57de7255b432c4f4d7026c155d51570c3e (diff)
downloadohai-6579776fab7ae3b089002bc8e059c1b63cdcab20.tar.gz
Document another methodfix_openstack
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/mixin/ec2_metadata.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ohai/mixin/ec2_metadata.rb b/lib/ohai/mixin/ec2_metadata.rb
index c8816fd7..8f181769 100644
--- a/lib/ohai/mixin/ec2_metadata.rb
+++ b/lib/ohai/mixin/ec2_metadata.rb
@@ -48,6 +48,13 @@ module Ohai
EC2_ARRAY_DIR ||= %w{network/interfaces/macs}.freeze
EC2_JSON_DIR ||= %w{iam}.freeze
+ #
+ # The latest metadata version in EC2_SUPPORTED_VERSIONS that this instance supports
+ # in AWS supported metadata versions are determined at instance start so we need to be
+ # cautious here in case an instance has been running for a long time
+ #
+ # @return [String] the version
+ #
def best_api_version
@api_version ||= begin
logger.trace("Mixin EC2: Fetching http://#{EC2_METADATA_ADDR}/ to determine the latest supported metadata release")