Skip to content

Commit

Permalink
OHAI-434: Raise error when no supported EC2 metadata version is found
Browse files Browse the repository at this point in the history
  • Loading branch information
javmorin committed Apr 12, 2013
1 parent ee04f0d commit 9dc1965
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ohai/mixin/ec2_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def best_api_version
Ohai::Log.debug("EC2 shows unsupported metadata version: #{pv}") unless pv == 'latest'
end
Ohai::Log.debug("EC2 metadata version: #{versions.last}")
if versions.empty?
raise "Unable to determine EC2 metadata version (no supported entries found)"
end
versions.last
end

Expand Down

0 comments on commit 9dc1965

Please sign in to comment.