Bug #2844
Recursion with purge doesn't purge some files
| Status: | Closed | Start date: | 11/19/2009 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | file | |||
| Target version: | 0.25.2 | |||
| Affected Puppet version: | 0.25.1 | Branch: | http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844 | |
| Keywords: | file recursion | |||
| Votes: | 0 |
Description
Run the following manifest:
node default
{
file {
"/tmp/testdir":
ensure => directory,
recurse => true, purge => true;
"/tmp/testdir/foo":
content => "FOO!\n";
}
}
Works as it should. Now, manually create two extra files:
# touch /tmp/testdir/foo2 /tmp/testdir/bar
and run the above manifest again. It only removes the “bar” file. This seems true for any “stray” file which starts with the same prefix as a file that is managed by the manifests.
This works in 0.24.8, but is broken in 0.25.1. I’ll try to bisect it closer tomorrow, but I don’t have more time tonight.
This could be pretty bad. I was building up my iptables rules from file fragments, and when I removed one rule from my Puppet manifests, the corresponding file wasn’t removed, and was thus left in the total. Luckily I noticed it on a test system…
Related issues
History
Updated by James Turnbull about 2 years ago
- Status changed from Unreviewed to Investigating
- Assignee set to Markus Roberts
Updated by Markus Roberts about 2 years ago
Reproduced and bisected. It came in with:
commit b3b76dffdd9cd8ed5c3d0230624bf05015bec5b8 Author: Luke Kanies luke@madstop.com Date: Thu Jul 23 16:51:22 2009 -0700
Fixing #2296 - overlapping recursions work again
This fixes the behaviour when you have file recursions
that overlap - we again correctly use the most
specific information.
It's still a bit expensive when you do this, but
at least it behaves correctly, and it should be
a rare circumstance.
Signed-off-by: Luke Kanies <luke@madstop.com>
Updated by Markus Roberts about 2 years ago
- Status changed from Investigating to Accepted
Updated by Markus Roberts about 2 years ago
- Status changed from Accepted to In Topic Branch Pending Review
- Keywords set to file recursion
- Branch set to http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844
Branch up at http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844
I’ve tested it.
Updated by Markus Roberts about 2 years ago
Worked for Thomas too.
Updated by James Turnbull about 2 years ago
- Status changed from In Topic Branch Pending Review to Ready For Checkin
Updated by James Turnbull about 2 years ago
- Status changed from Ready For Checkin to Closed
Pushed in commit:53b3b86681e3c56f8455e5d8458b4ea900a50406 in branch 0.25.x