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. # Defaults to undef.
# #
class heat::cron::purge_deleted ( class heat::cron::purge_deleted (
$ensure = present, Enum['present', 'absent'] $ensure = present,
$minute = 1, $minute = 1,
$hour = 0, $hour = 0,
$monthday = '*', $monthday = '*',
$month = '*', $month = '*',
$weekday = '*', $weekday = '*',
$maxdelay = 0, $maxdelay = 0,
$user = $::heat::params::user, $user = $::heat::params::user,
$age = 1, $age = 1,
$age_type = 'days', Enum['days', 'hours', 'minutes', 'seconds'] $age_type = 'days',
$destination = '/var/log/heat/heat-purge_deleted.log', $destination = '/var/log/heat/heat-purge_deleted.log',
$batch_size = undef, $batch_size = undef,
) inherits heat::params { ) 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 { if $maxdelay == 0 {
$sleep = '' $sleep = ''
} else { } else {

View File

@ -109,16 +109,6 @@ describe 'heat::cron::purge_deleted' do
) )
end end
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 end
on_supported_os({ on_supported_os({