[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80
Jacob Helwig
jacob at puppetlabs.com
Mon Feb 7 06:42:05 UTC 2011
The following commit has been merged in the upstream branch:
commit 6c93eb2c142e346077c49ef78a5fcf675eeb2698
Author: Jacob Helwig <jacob at puppetlabs.com>
Date: Tue Feb 1 14:37:34 2011 -0800
Remove order dependency when specifying source and checksum on File type
If source was specified after setting the checksum, it would cause the
checksum to be set back to :md5. This was completely unnecessary, because
the checksum has its own default of :md5.
Paired-with: Jesse Wolfe <jesse at puppetlabs.com>
diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb
index 7d03de2..bc464e1 100755
--- a/lib/puppet/type/file/source.rb
+++ b/lib/puppet/type/file/source.rb
@@ -169,7 +169,6 @@ module Puppet
checks.delete(:checksum)
resource[:audit] = checks
- resource[:checksum] = :md5 unless resource.property(:checksum)
end
def local?
diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb
index db0fa9f..944bd6b 100755
--- a/spec/unit/type/file_spec.rb
+++ b/spec/unit/type/file_spec.rb
@@ -1096,4 +1096,19 @@ describe Puppet::Type.type(:file) do
File.exists?(@path).should == true
end
end
+
+ describe "when specifying both source and checksum" do
+ it 'should use the specified checksum when source is first' do
+ @file[:source] = '/foo'
+ @file[:checksum] = :md5lite
+
+ @file[:checksum].should be :md5lite
+ end
+ it 'should use the specified checksum when source is last' do
+ @file[:checksum] = :md5lite
+ @file[:source] = '/foo'
+
+ @file[:checksum].should be :md5lite
+ end
+ end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list