Skip to content

Instantly share code, notes, and snippets.

@hunner
Created November 14, 2011 20:04
Show Gist options
  • Save hunner/1364979 to your computer and use it in GitHub Desktop.
Save hunner/1364979 to your computer and use it in GitHub Desktop.
EC2 fix
diff --git a/lib/facter/ec2.rb b/lib/facter/ec2.rb
index c52f76b..ebfdcff 100644
--- a/lib/facter/ec2.rb
+++ b/lib/facter/ec2.rb
@@ -23,9 +23,8 @@ def metadata(id = "")
if key[-1..-1] != '/'
value = open("http://169.254.169.254/2008-02-01/meta-data/#{key}").read.
split("\n")
- value = value.size>1 ? value : value.first
symbol = "ec2_#{key.gsub(/\-|\//, '_')}".to_sym
- Facter.add(symbol) { setcode { value } }
+ Facter.add(symbol) { setcode { value.join(',') } }
else
metadata(key)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment