Skip to content

Instantly share code, notes, and snippets.

@sean-horn
Created February 13, 2013 17:42
Show Gist options
  • Save sean-horn/4946481 to your computer and use it in GitHub Desktop.
Save sean-horn/4946481 to your computer and use it in GitHub Desktop.
Reading the cookbook collection to get the list of cookbooks/versions used
log "---writing all ckbks and version---"
cookbooks = @run_context.cookbook_collection
log "The recipes were these: #{cookbooks.keys.map {|x| cookbooks[x].name + " " + cookbooks[x].version} }"
log "---End writing all ckbks and version---"
@dmalikov
Copy link

Chef::Log.info "---writing all ckbks and version---"
cookbooks = @run_context.cookbook_collection
cookbooks.keys.each do |k|
  Chef::Log.info "#{cookbooks[k].name} : #{cookbooks[k].version}"
end
Chef::Log.info "---End writing all ckbks and version---"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment