Skip to content

Commit c8c47cb

Browse files
committed
(PA-5266) Change checksum algorithm to default
Prior to this commit, the puppet_agent::prepare::package class used the sha256lite algorithm in the file resource for local installation packages. In certain circumstances (e.g. when a download is interrupted), this checksum, which only checks the first N bytes, does not provide sufficient information to determine if the file is actually there. This commit removes the checksum attribute altogether, which causes the file resource to use its default algorithm, sha256. This algorithm should handle circumstances like those outlined above.
1 parent ffc0575 commit c8c47cb

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

manifests/prepare/package.pp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
}
2828

2929
file { $local_package_file_path:
30-
ensure => file,
31-
owner => $puppet_agent::params::user,
32-
group => $puppet_agent::params::group,
33-
mode => $mode,
34-
source => $source,
35-
require => File[$puppet_agent::params::local_packages_dir],
36-
checksum => sha256lite,
30+
ensure => file,
31+
owner => $puppet_agent::params::user,
32+
group => $puppet_agent::params::group,
33+
mode => $mode,
34+
source => $source,
35+
require => File[$puppet_agent::params::local_packages_dir],
3736
}
3837
}

spec/classes/puppet_agent_osfamily_redhat_spec.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,13 @@
292292

293293
it {
294294
is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-6.12.0.rpm')
295-
.with('path' => '/opt/puppetlabs/packages/puppet-agent-6.12.0.rpm')
296-
.with('ensure' => 'file')
297-
.with('owner' => '0')
298-
.with('group' => '0')
299-
.with('mode' => '0644')
300-
.with('source' => 'http://just-some-download/url:90/puppet-agent-6.12.0.rpm')
295+
.with('path' => '/opt/puppetlabs/packages/puppet-agent-6.12.0.rpm')
296+
.with('ensure' => 'file')
297+
.with('owner' => '0')
298+
.with('group' => '0')
299+
.with('mode' => '0644')
300+
.with('source' => 'http://just-some-download/url:90/puppet-agent-6.12.0.rpm')
301301
.that_requires('File[/opt/puppetlabs/packages]')
302-
.with('checksum' => 'sha256lite')
303302
}
304303

305304
it {

0 commit comments

Comments
 (0)