[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:32:13 UTC 2010
The following commit has been merged in the upstream branch:
commit 3eeebf51f8b444193227c36162d4e74a95e96b79
Author: Luke Kanies <luke at reductivelabs.com>
Date: Fri Mar 19 22:13:38 2010 -0700
Fixing change printing for content/ensure
Signed-off-by: Luke Kanies <luke at reductivelabs.com>
diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index a8a5e7c..b6c671b 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -43,8 +43,8 @@ module Puppet
# Checksums need to invert how changes are printed.
def change_to_s(currentvalue, newvalue)
# Our "new" checksum value is provided by the source.
- if source = resource.parameter(:source)
- newvalue = source.checksum || "unknown checksum"
+ if source = resource.parameter(:source) and tmp = source.checksum
+ newvalue = tmp
end
if currentvalue == :absent
return "defined content as '%s'" % [newvalue]
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb
index fc4bbea..b2dd394 100755
--- a/lib/puppet/type/file/ensure.rb
+++ b/lib/puppet/type/file/ensure.rb
@@ -42,7 +42,7 @@ module Puppet
newvalue(:file, :event => :file_created) do
# Make sure we're not managing the content some other way
- if property = (@resource.property(:content) || @resource.property(:source))
+ if property = @resource.property(:content)
property.sync
else
@resource.write("", :ensure)
@@ -108,8 +108,13 @@ module Puppet
else
should = property.should
end
+ if should == :absent
+ is = property.retrieve
+ else
+ is = :absent
+ end
- return property.change_to_s(property.retrieve, should)
+ return property.change_to_s(is, should)
end
# Check that we can actually create anything
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list