zuazo / dovecot-cookbook

Chef cookbook to install and configure Dovecot.
https://supermarket.chef.io/cookbooks/dovecot
Apache License 2.0
26 stars 33 forks source link

Update ohai cookbook for namespace deprecation #30

Open ccrebolder opened 6 years ago

ccrebolder commented 6 years ago

Cookbook Version

3.2.1 and master

Chef Client Version

The deprecation notice is visible in chef-client 13 and applies to upcoming chef-client 14.

Platform Details

Applies to all platforms

Scenario

I've been doing an inventory and clean up of the various Chef 14 deprecations in our environment. This one is actually coming from the dependent ohai cookbook and is fixed in the later (~> 5.0) versions.

I was going to submit quick PR with the version bump but then realized that this version of ohai is dependent on chef >= 12.7 and so would be a breaking change for anyone on chef-client versions 12.0-12.6. Not sure how you'd like to handle that.

Steps to Reproduce

in .kitchen.yml:

provisioner:
  name: chef_zero
  require_chef_omnibus: 13
  data_bags_path: ./test/data_bags
  client_rb:
    treat_deprecation_warnings_as_errors: true # WiP on some depends

and converge any suite.

Expected Result

converges successfully

Actual Result

           ================================================================================
           Error executing action `create` on resource 'ohai_plugin[dovecot]'
           ================================================================================

           Chef::Exceptions::DeprecatedFeatureError
           ----------------------------------------
           "rename path to new_resource.path (CHEF-19)/tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:13:in `desired_plugin_path'.\nPlease see https://docs.chef.io/deprecations_namespace_collisions.html for further details and information on how to correct this proble
m. at /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/formatters/doc.rb:419:in `deprecation'"

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:13:in `desired_plugin_path'
           /tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:80:in `block in class_from_file'
           /tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:131:in `block in after_created'
           /tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:130:in `each'
           /tmp/kitchen/cache/cookbooks/ohai/resources/plugin.rb:130:in `after_created'
           /tmp/kitchen/cache/cookbooks/dovecot/recipes/ohai_plugin.rb:34:in `from_file'
           /tmp/kitchen/cache/cookbooks/dovecot/recipes/default.rb:22:in `from_file'
           /tmp/kitchen/cache/cookbooks/dovecot_test/recipes/default.rb:22:in `from_file'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/dovecot/recipes/ohai_plugin.rb

            34: ohai_plugin 'dovecot' do
            35:   name 'dovecot'
            36:   source_file "#{source_dir}/dovecot.rb.erb"
            37:   resource :template
            38:   variables enable_build_options: ohai_build_options
            39: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/dovecot/recipes/ohai_plugin.rb:34:in `from_file'

           ohai_plugin("dovecot") do
             action [:create]
             default_guard_interpreter :default
             declared_type :ohai_plugin
             cookbook_name "dovecot"
             recipe_name "ohai_plugin"
             source_file "ohai7_plugins/dovecot.rb.erb"
             resource :template
             variables {:enable_build_options=>true}
             plugin_name "dovecot"
           end

           System Info:
           ------------
           chef_version=13.8.5
           platform=ubuntu
           platform_version=16.04
           ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
           program_name=chef-client worker: ppid=1720;start=15:49:35;
           executable=/opt/chef/bin/chef-client
zuazo commented 6 years ago

Thanks for the report!

Maybe I should make a release tomorrow including the unreleased changes in master, then do a major bump with the dependency update. What do you think?

ccrebolder commented 6 years ago

I agree that's probably the way to go. Chef 14 is still almost four weeks away too if there were any other breaking changes you wanted to roll in.

ccrebolder commented 6 years ago

I should note too that Chef 12 will actuually be EOL at the end of April: https://www.chef.io/eol-chef12-and-chefdk1/

dermarens commented 6 years ago

Any plans for the new release already? Trying to reach chef-14 compatibility now that chef-12 is EOL and chef-13 is deprecated.

ledgr commented 6 years ago

@zuazo cloud you roll out a fix/update?

dermarens commented 6 years ago

Had a look at it but there still seems to be some more work to do https://travis-ci.org/dermarens/dovecot-cookbook/jobs/391843519

jayhendren commented 5 years ago

Any chance a new release could be rolled out? The merged PR seems to do a fine job of fixing this issue; would like to see it on Supermarket

julianrutten commented 5 years ago

May I ask why this isnt up yet? If you don't want to maintain the package I bet somebody else would be willing to.

lordkage commented 3 years ago

Is there any status on this cookbook update?

lordkage commented 3 years ago

Has there been any update on this issue?

lordkage commented 2 years ago

We are now on Chef 17, is there any update?