Merge "Validate status of cron resource"

This commit is contained in:
Zuul 2023-06-28 15:42:58 +00:00 committed by Gerrit Code Review
commit 23c75218ce
2 changed files with 12 additions and 26 deletions

View File

@ -51,24 +51,20 @@
# Defaults to undef.
#
class heat::cron::purge_deleted (
$ensure = present,
$minute = 1,
$hour = 0,
$monthday = '*',
$month = '*',
$weekday = '*',
$maxdelay = 0,
$user = $::heat::params::user,
$age = 1,
$age_type = 'days',
$destination = '/var/log/heat/heat-purge_deleted.log',
$batch_size = undef,
Enum['present', 'absent'] $ensure = present,
$minute = 1,
$hour = 0,
$monthday = '*',
$month = '*',
$weekday = '*',
$maxdelay = 0,
$user = $::heat::params::user,
$age = 1,
Enum['days', 'hours', 'minutes', 'seconds'] $age_type = 'days',
$destination = '/var/log/heat/heat-purge_deleted.log',
$batch_size = undef,
) inherits heat::params {
if ! member(['days', 'hours', 'minutes', 'seconds'], $age_type) {
fail('age_type possible values are only days, hours, minutes, or seconds.')
}
if $maxdelay == 0 {
$sleep = ''
} else {

View File

@ -109,16 +109,6 @@ describe 'heat::cron::purge_deleted' do
)
end
end
describe 'when setting a wrong age_type' do
before :each do
params.merge!(
:age_type => 'foobar'
)
end
it_raises 'a Puppet::Error', /age_type possible values are only days, hours, minutes, or seconds./
end
end
on_supported_os({