lib/specinfra/ec2_metadata.rb in specinfra-2.82.7 vs lib/specinfra/ec2_metadata.rb in specinfra-2.82.8
- old
+ new
@@ -12,9 +12,12 @@
@metadata = get_metadata
self
end
def [](key)
+ if key.is_a?(Symbol)
+ key = key.to_s
+ end
if @metadata[key].nil?
begin
require "specinfra/ec2_metadata/#{key}"
inventory_class = Specinfra::Ec2Metadata.const_get(key.to_s.to_camel_case)
@metadata[key] = inventory_class.new(@host_inventory).get