sous-chefs / ark

Development repository for the ark cookbook
https://supermarket.chef.io/cookbooks/ark
Apache License 2.0
99 stars 181 forks source link

Notfies :before property doubles the leaf-directory #196

Open TomKemperNL opened 7 years ago

TomKemperNL commented 7 years ago

Cookbook version

3.1.0

Chef-client version

12.19.36

Platform Details

Windows 10 (15063)

Scenario:

Combining the ark resource :put action with notifies

Steps to Reproduce:

My resource is declared like

ark 'some_application' do
  action :put
  name "app_test"
  url "someurl"
  path "C:/Temp"
  strip_components 0
  notifies :stop, 'service[someService]', :before
end

Expected Result:

I would expect the zip to be expanded to C:/Temp/app_test

Actual Result:

The zip is expanded to C:/Temp/app_test/app_test. If I comment out the notifies property, it works correctly. If I only use notified :immediate or :delayed, it works correctly

TomKemperNL commented 7 years ago

Nope, it wasn't gone. I just retested with Chef Client 13.2.20 while it was still commented out.

Furthermore a colleague of mine has the same problem on Ubuntu 16.

TomKemperNL commented 7 years ago

This is probably caused by the fact that notify :before triggers a why-run. However action :put will call set_put_paths during both the real and the why-run, joining the resource name onto the path twice.

TomKemperNL commented 7 years ago

I'm somewhat concerned by the complete silence. Is there something wrong with the issue? Is there anything I can do to help? Is everyone just on summer vacation?

dosyfier commented 5 years ago

I just faced the very same issue on one of my projects, corrected it and saw this 2-year old ticket. I submitted a PR with modifications to support the why-run mode and correct the problem described here. Hopefully it will be accepted...

fasmat commented 4 years ago

I'm also affected by exactly this bug.

I'm notifying another resource with the :before timing which seems to confuse ark and have the root dictionary doubled. Without the notify it works as expected.

github-actions[bot] commented 3 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 3 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

damacus commented 3 years ago

I need to check if this is still a bug, but I highly suspect it is!