chef: knife cookbook site share doesn't work
I’m getting the error when trying to release a new version for the aegir3 cookbook (https://github.com/daften/cookbook-aegir3):
ERROR: knife encountered an unexpected error
This may be a bug in the 'cookbook site share' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NameError: undefined local variable or method `method_name' for Chef::Cookbook::Metadata:Class
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (8 by maintainers)
Awesome! if anyone needs to manually patch that commit will likely work, and it’s super simple.
We’re discussing a more complete patch here: https://github.com/chef/chef/pull/4428
I ran into this while trying to share a cookbook with only
metadata.rb, however it was managed by Berkshelf, and was first:berks installberks upload~/src/pub/chef-repo/cookbooks) withberks vendor cookbooks/knife cookbook site share my-cookbook "Applications" -o cookbooksDue to the back & forth from Chef Server with
berks upload&berks vendor, themetadata.rbgets converted intometadata.json. Thus,knife cookbook site share my-cookbook "Applications" -o cookbooks -VVreturned an error:After manually applying @andy-dufour’s patch above to my ChefDK install at:
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/cookbook/metadata.rb, I re-ranknife cookbook site share my-cookbook "Applications" -o cookbooksand it worked!So, this patch worked for me: https://github.com/chef/chef/commit/3d769be3383f7f73c3ee6ed7bce75e40f2ae56c6