summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schmitt <david@schmitt.edv-bus.at>2007-11-09 19:25:09 +0100
committerDavid Schmitt <david@schmitt.edv-bus.at>2007-11-09 19:25:09 +0100
commit445c29c4b108e04b3f077316b36ba50284a7d5d5 (patch)
tree5b6be7f516cdc112f674d4bc7e5784c79fe7c858
parent5726412cb7289c6cfbc421d9081d690ffa48ba9a (diff)
downloadpuppet-445c29c4b108e04b3f077316b36ba50284a7d5d5.tar.gz
puppet-445c29c4b108e04b3f077316b36ba50284a7d5d5.tar.xz
puppet-445c29c4b108e04b3f077316b36ba50284a7d5d5.zip
fix #872: improve property(:content).insync?
This commit applies ctrlaltdel's patch from trac #872
-rwxr-xr-xlib/puppet/type/pfile/content.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/type/pfile/content.rb b/lib/puppet/type/pfile/content.rb
index 11458ef18..6dcda0aa6 100755
--- a/lib/puppet/type/pfile/content.rb
+++ b/lib/puppet/type/pfile/content.rb
@@ -33,7 +33,13 @@ module Puppet
end
# Override this method to provide diffs if asked for.
+ # Also, fix #872: when content is used, and replace is true, the file
+ # should be insync when it exists
def insync?(is)
+ if ! @resource.replace? and File.exists?(@resource[:path])
+ return true
+ end
+
result = super
if ! result and Puppet[:show_diff] and File.exists?(@resource[:path])
string_file_diff(@resource[:path], self.should)