-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
NoMethodError: undefined method `path' for Chef::Resource::Execute #2545
Comments
We saw this in the rabbitmq cookbook: rabbitmq/chef-cookbook#175 |
This is missing because execute "mycommand" do
environment "PATH" => "/my/path/to/bin:#{ENV["PATH"]}"
end Note that environment overwrites the entire $PATH here, as it is not additive, hence the string interpolation w/ |
Per @sersut:
We'll note this as a known issue in the release blog post for Chef 12, and ensure the appropriate documentation is updated. |
I would propose adding a deprecation warning there (to the Chef client, not to cookbook). A big fat one. Primarily to ease customers into the transition where we introduce braking change in the API. There is a big difference between |
Yeah we probably should have had a deprecation warning first in a world with perfect process, but I think this has shipped in a dot-0 major release and the breakage is acceptable and the new behavior is correct, and we should not revert. |
Just a note, it is also affecting the https://github.com/hw-cookbooks/postgresql/blob/develop/recipes/ruby.rb#L88 |
@hulu1522 That isn't related to this issue, which addresses removal of the execute "mycommand" do
path "/home/mystuff/bin:#{ENV['PATH']}"
end The issue with the postgresql::ruby cookbook is separate and any failure there should be filed as an issue against that cookbook (if one doesn't exist). |
I see you found the issue 🍰. I'll reply there. |
We should put this back in. It's a tiny fix that doesn't cause any problems to anyone, and hopefully cut a release. Feel free to put a deprecation warning back in. |
Fixed with #2571 |
In Chef 12, using an execute resource with a
path
attribute results in aNoMethodError
exception.More details coming, wanted to get this created.
The text was updated successfully, but these errors were encountered: