Created
September 4, 2012 13:54
-
-
Save turtlebender/3621364 to your computer and use it in GitHub Desktop.
strange data bag result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"gearbox": { | |
"data_bags": { | |
"pypi": [ | |
"gearbox" | |
] | |
}, | |
"apps": [ | |
"pypi" | |
], | |
"artifact_bucket": "s3_ops" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chef > node["gearbox"]["data_bags"].keys | |
=> ["pypi"] | |
chef > node["gearbox"]["data_bags"].values | |
=> [["gearbox"]] | |
chef > node["gearbox"]["data_bags"].each do |k, v| | |
chef > print "k=#{k}\n" | |
chef ?> print "v=#{v}" | |
chef ?> end | |
k=pypi | |
v=["gearbox"] => ["pypi"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chef > databags ||= { } | |
=> {} | |
chef > node["gearbox"]["encrypted_data_bags"].to_hash.each do |k,v| | |
chef > databags[k] = v.map do |args| | |
chef > Chef::EncryptedDataBagItem.load(*args).to_hash | |
chef ?> end | |
chef ?> end | |
=> {} | |
chef > node["gearbox"]["data_bags"].to_hash.each do |k,v| | |
chef > databags[k] = v.map do |args| | |
chef > data_bag_item(*args).to_hash | |
chef ?> end | |
chef ?> end | |
ArgumentError: wrong number of arguments (1 for 2) | |
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/language.rb:238:in `data_bag_item' | |
from (irb):9:in `block (2 levels) in irb_binding' | |
from (irb):8:in `map' | |
from (irb):8:in `block in irb_binding' | |
from (irb):7:in `each' | |
from (irb):7 | |
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/shef.rb:73:in `block in start' | |
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/shef.rb:72:in `catch' | |
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/shef.rb:72:in `start' | |
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/bin/shef:34:in `<top (required)>' | |
from /usr/bin/shef:19:in `load' | |
from /usr/bin/shef:19:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment