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

Notfies :before property doubles the leaf-directory #196

Open
TomKemperNL opened this issue Jul 13, 2017 · 8 comments
Open

Notfies :before property doubles the leaf-directory #196

TomKemperNL opened this issue Jul 13, 2017 · 8 comments
Labels
Bug Something isn't working

Comments

@TomKemperNL
Copy link

TomKemperNL commented Jul 13, 2017

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

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 TomKemperNL reopened this Jul 13, 2017
@TomKemperNL TomKemperNL changed the title Notfies property doubles the leaf-directory Notfies :before property doubles the leaf-directory Jul 13, 2017
@TomKemperNL
Copy link
Author

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

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 added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
@dosyfier
Copy link

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...

dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
dosyfier added a commit to dosyfier/ark that referenced this issue Aug 25, 2019
Ark resource wasn't supporting whyrun mode because of its overwritting
of resource attributes set by user recipes (especially the path attr).

By introducing new "internal" resource attribute ("_deploy_path" and
"_release_file"), which are set by and only by ark's resource internal
implementation, this resource is now whyrun compliant and constructs
involving `notifies :action, 'other_resource[name]', :before` are now
possible.

Signed-off-by: Christophe Sourisse <[email protected]>
@fasmat
Copy link

fasmat commented Oct 21, 2019

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

github-actions bot commented Jan 8, 2021

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 github-actions bot added the Stale This is marked as stale and will be closed shortly label Jan 8, 2021
@github-actions
Copy link

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 damacus reopened this May 14, 2021
@damacus damacus added Bug Something isn't working and removed Stale This is marked as stale and will be closed shortly labels May 14, 2021
@damacus
Copy link
Member

damacus commented May 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants