Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ohai cookbook for namespace deprecation #30

Open
ccrebolder opened this issue Mar 8, 2018 · 11 comments
Open

Update ohai cookbook for namespace deprecation #30

ccrebolder opened this issue Mar 8, 2018 · 11 comments

Comments

@ccrebolder
Copy link

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
Copy link
Owner

zuazo commented Mar 8, 2018

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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link
Contributor

ledgr commented Jul 5, 2018

@zuazo cloud you roll out a fix/update?

@dermarens
Copy link

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

@dermarens dermarens mentioned this issue Jul 26, 2018
3 tasks
@ledgr ledgr mentioned this issue Jul 31, 2018
8 tasks
@jayhendren
Copy link

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
Copy link

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
Copy link

lordkage commented Oct 8, 2020

Is there any status on this cookbook update?

@lordkage
Copy link

Has there been any update on this issue?

@lordkage
Copy link

lordkage commented Jan 1, 2022

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

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

No branches or pull requests

7 participants