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

Unwind does not remove resource attributes associated during initial declaration. #23

Open
TonyLovesDevOps opened this issue Oct 11, 2016 · 0 comments

Comments

@TonyLovesDevOps
Copy link

TonyLovesDevOps commented Oct 11, 2016

Tested with chef-client 12.6.0/12.14.89 and chef-rewind 0.0.9.

We're trying to use unwind to remove some notifications from a declared resource, then redefining the resource with the correct attributes. However, the redefined resource still has the old notifications.

Our code looks like:

file '/tmp/unwind_example/bar' do
  action :nothing
end

# This will break because the containing directory doesn't yet exist
directory '/tmp/unwind_example' do
  notifies :create, 'file[/tmp/unwind_example/bar]', :before
end

# Lets fix the directory resource by unwinding and redefining it with a valid notification
unwind 'directory[/tmp/unwind_example]'

directory '/tmp/unwind_example' do
  action :create
  notifies :create, "file[/tmp/unwind_example/bar]", :delayed
end

However, this code fails to converge with Parent directory /tmp/unwind_example does not exist.

Here's an example cookbook showing this behavior.

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

No branches or pull requests

1 participant