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

Chef 12 possible incompatibility with LWRP usage inside cookbook libraries? #2591

Closed
nomadium opened this issue Dec 9, 2014 · 2 comments
Closed

Comments

@nomadium
Copy link

nomadium commented Dec 9, 2014

Hi folks,

I don't know if this a bug or if I just missed some change from Chef 12.0.0 changelog.

When you upgrade from Chef 11.16.4-1 to Chef 12.0.0 rvm community cookbook (0.9.2) stops working in some cases. The exact issue is: sous-chefs/rvm#283.

In rvm cookbook, Chef::Provider::Package::RVMRubygems resource is defined with a library and some method in that class instantiates a resource that was defined as a LWRP (rvm_environment) in the same cookbook. This code used to work until 11.16.4-1, when you switch to Chef 12.0.0 it breaks.

If you instantiate the problematic resource with its full class name, then you can work around this issue but I don't know if this is the correct solution.

I'm aware Chef 12.0.0 deprecated some old things and switched some defaults but I'm not sure about this change that I'm describing.

Can somebody provide some insight on this?

Thanks,

@akshah123
Copy link

👍 I am also blocked by this. It would be nice to know if this a bug or known deprecated functionality.

@lamont-granquist
Copy link
Contributor

Known deprecated functionality. You can either inherit from Chef::Provider::LWRPBase instead of Chef::Provider in order to mixin the recipe DSL into your provider or do the workaround in https://github.com/fnichol/chef-rvm/pull/284/files -- the latter is 'better' in that it avoids mixing the method_missing magic back in and we avoided that for a reason, but the former is a much easier patch.

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

No branches or pull requests

3 participants