From 4fa800805dc87a84c2af6281305e6015c44207e9 Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 8 Mar 2007 19:07:07 +0000 Subject: Fixing a few of the log messages so file content changes always include the md5 sum git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2274 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/pfile/ensure.rb | 8 ++++++++ lib/puppet/type/pfile/source.rb | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/type/pfile/ensure.rb b/lib/puppet/type/pfile/ensure.rb index 076dfbdcf..bb4b3d27a 100755 --- a/lib/puppet/type/pfile/ensure.rb +++ b/lib/puppet/type/pfile/ensure.rb @@ -108,6 +108,14 @@ module Puppet return :link end + def change_to_s + if property = (@parent.property(:content) || @parent.property(:source)) + return property.change_to_s + else + super + end + end + # Check that we can actually create anything def check basedir = File.dirname(@parent[:path]) diff --git a/lib/puppet/type/pfile/source.rb b/lib/puppet/type/pfile/source.rb index 2d569f2ed..072d2cfe2 100755 --- a/lib/puppet/type/pfile/source.rb +++ b/lib/puppet/type/pfile/source.rb @@ -65,7 +65,12 @@ module Puppet end def change_to_s - return "replacing from source %s with contents %s" % [@source, @stats[:checksum]] + should = "{md5}" + @stats[:checksum] + if @parent.is(:ensure) == :absent + return "creating from source %s with contents %s" % [@source, @stats[:checksum]] + else + return "replacing from source %s with contents %s" % [@source, @stats[:checksum]] + end end def checksum -- cgit