summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-01 00:34:11 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-01 00:34:11 +0000
commit173f5cc03640a119e77a39047cd7f4f6f0fa1a4e (patch)
tree44a8cb0cd29889e7bb10f235ebc526192d126c90 /lib/puppet
parent62ab87309abcbc80d469c68ee210f34f566f42c0 (diff)
downloadpuppet-173f5cc03640a119e77a39047cd7f4f6f0fa1a4e.tar.gz
puppet-173f5cc03640a119e77a39047cd7f4f6f0fa1a4e.tar.xz
puppet-173f5cc03640a119e77a39047cd7f4f6f0fa1a4e.zip
Fixing a purging bug introduced by [2138]. I had to move the purge check to the recurse method, rather than the localrecurse method, because the purge check needs to happen after sourcerecurse.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2139 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type/pfile.rb22
-rwxr-xr-xlib/puppet/type/pfile/source.rb4
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 650c7ad26..93d715f01 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -546,12 +546,15 @@ module Puppet
if child = self.newchild(file, true, options)
# Mark any unmanaged files for removal if purge is set.
# Use the array rather than [] because tidy uses this method, too.
- if @parameters.include?(:purge) and self.purge?
- info "purging %s" % child.ref
- child[:ensure] = :absent
- else
- child[:require] = self
- end
+# if @parameters.include?(:purge) and self.purge?
+# child.info "source: %s" % child.should(:source)
+# unless child.managed?
+# info "purging %s" % child.ref
+# child[:ensure] = :absent
+# end
+# #else
+# #child[:require] = self
+# end
added << child
end
}
@@ -707,6 +710,13 @@ module Puppet
if @states.include?(:source) and ret = self.sourcerecurse(recurse)
children += ret
end
+
+ # The purge check needs to happen after all of the other recursion.
+ if self.purge?
+ children.each do |child|
+ child[:ensure] = :absent unless child.managed?
+ end
+ end
children
end
diff --git a/lib/puppet/type/pfile/source.rb b/lib/puppet/type/pfile/source.rb
index 89a7d1990..7cbd54fe0 100755
--- a/lib/puppet/type/pfile/source.rb
+++ b/lib/puppet/type/pfile/source.rb
@@ -173,7 +173,9 @@ module Puppet
case @stats[:type]
when "directory", "file":
- unless @parent.deleting?
+ if @parent.deleting?
+ p @parent.should(:ensure)
+ else
@parent[:ensure] = @stats[:type]
end
else