summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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