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

Add acceptance test and documentation for file autorequire #113

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

bastelfreak
Copy link
Member

In #106 I wanted to
implement an autorequire for file resources. I noticed that the type
already has code to autorequire stuff:

if autorequire_type != :posix_acl
if self[:recursive] == :true
catalog.resources.select do |r|
r.is_a?(Puppet::Type.type(autorequire_type)) && self.class.descendant?(self[:path], r[:path])
end.each do |found| # rubocop:disable Style/MultilineBlockChain
req << found[:path]
end
end
req << self[:path]

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@bastelfreak bastelfreak force-pushed the filedeps branch 2 times, most recently from 34cb2a1 to e1352b6 Compare January 26, 2022 08:46
@bastelfreak
Copy link
Member Author

Given that the tests pass. I think we can close #106

@bastelfreak bastelfreak changed the title Add acceptance test for file autorequire Add acceptance test and documentation for file autorequire Jan 26, 2022
In voxpupuli#106 I wanted to
implement an autorequire for file resources. I noticed that the type
already has code to autorequire stuff:
https://github.com/voxpupuli/puppet-posix_acl/blob/3f267b290d7e3e1b4f64a2093f63ec9ac890766e/lib/puppet/type/posix_acl.rb#L95-L103

if you run with --debug:
```
Debug: /Stage[main]/Main/Posix_acl[/opt/test3]: Adding autorequire
relationship with File[/opt/test3]
Debug: /Stage[main]/Main/Posix_acl[/opt/test3]: Adding autorequire
relationship with Package[acl]
```
@bastelfreak bastelfreak merged commit 4417fbe into voxpupuli:master Jan 26, 2022
@bastelfreak bastelfreak deleted the filedeps branch January 26, 2022 09:22
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

Successfully merging this pull request may close these issues.

2 participants