summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/file/content.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index d571e469b..ff71a55ce 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -36,6 +36,21 @@ module Puppet
end
end
+ # Checksums need to invert how changes are printed.
+ def change_to_s(currentvalue, newvalue)
+ # Our "new" checksum value is provided by the source.
+ unless source = resource.parameter(:source) and newvalue = source.checksum
+ newvalue = "unknown checksum"
+ end
+ if currentvalue == :absent
+ return "defined content as '%s'" % [newvalue]
+ elsif newvalue == :absent
+ return "undefined content from '%s'" % [currentvalue]
+ else
+ return "content changed '%s' to '%s'" % [currentvalue, newvalue]
+ end
+ end
+
def checksum_type
if source = resource.parameter(:source)
result = source.checksum