berkshelf / ridley

A reliable Chef API client with a clean syntax
Other
231 stars 85 forks source link

Support For Privacy Flag For Supermarket #291

Closed echohack closed 7 years ago

echohack commented 9 years ago

In reference to issue: https://github.com/opscode/supermarket/issues/832

Currently Berkshelf throws an error if you try to do berks install with the privacy flag set in your metadata:

MyComputerName:my_cookbook echohack$ berks install --debug
An error occurred while reading the Berksfile:

  Could not parse `/Users/dechols/chef/vertafore-base/metadata.rb': undefined method `privacy' for #<Ridley::Chef::Cookbook::Metadata:0x007fbd717c9a80>
    /Users/dechols/chef/vertafore-base/metadata.rb:7:in `block in from_file'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/mixin/from_file.rb:31:in `instance_eval'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/mixin/from_file.rb:31:in `block in from_file'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/mixin/from_file.rb:74:in `with_error_handling'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/mixin/from_file.rb:30:in `from_file'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/mixin/from_file.rb:5:in `from_file'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:165:in `metadata'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:26:in `block (3 levels) in clean_room'
    /Users/dechols/chef/vertafore-base/Berksfile:3:in `block in dsl_eval_file'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:54:in `eval'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:54:in `block in dsl_eval_file'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:44:in `instance_eval'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:44:in `dsl_eval'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/mixin/dsl_eval.rb:54:in `dsl_eval_file'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:23:in `from_file'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:12:in `from_options'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:142:in `install'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:52:in `dispatch'
    /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:27:in `execute!'
    /opt/chefdk/embedded/apps/berkshelf/bin/berks:5:in `<top (required)>'
    /opt/chefdk/bin/berks:37:in `load'
    /opt/chefdk/bin/berks:37:in `<main>'

I suspect that ridley/chef/cookbook/metadata.rb needs another attribute added for privacy.

reset commented 9 years ago

@echohack this isn't a part of Chef's metadata so it didn't make it into the Ridley update that corresponded with Chef 12. If this is merged into Chef core then we can add the support but we really don't want to create divergent tools where only Berkshelf / Ridley understand how to process the metadata while Knife doesn't.

echohack commented 9 years ago

Here's the issue to add it to Chef's metadata.

https://github.com/opscode/chef/pull/2460

reset commented 9 years ago

Right, but it's not an accepted pull request. Ping back here once it is accepted ;).

perobertson commented 8 years ago

Looks like that PR got merged in back in August. I just ran into the same issue today.

thommay commented 7 years ago

this got merged in March to ridley.