Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

If can't find an expected piece of metadata, log and continue #283

Closed
wants to merge 1 commit into from

3 participants

@johnke

On certain instance types (e.g. hi.4xlarge), AWS returns 404 for certain pieces of metadata (e.g. on a hi.4xlarge, metrics/vhostmd returns 404). A half-completed ec2 section in ohai is still more helpful than an empty ec2 section, so log the error and continue, rather than raising an exception.

See also: https://tickets.opscode.com/browse/OHAI-541

@miketheman

I support this approach - some data is better than none.

@btm
Owner

@miketheman is working on a fix over at #332 that deals with returning a sane body and provides a unit test.

@btm btm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/ohai/mixin/ec2_metadata.rb
View
2  lib/ohai/mixin/ec2_metadata.rb
@@ -101,7 +101,7 @@ def http_client
def metadata_get(id, api_version)
response = http_client.get("/#{api_version}/meta-data/#{id}")
unless response.code == '200'
- raise "Encountered error retrieving EC2 metadata (returned #{response.code} response)"
+ Ohai::Log.debug("Encountered error retrieving EC2 metadata for /#{api_version}/meta-data/#{id} (returned #{response.code} response)")
end
response
end
Something went wrong with that request. Please try again.