Enable DB purge cron job after database is initialized

The DB purge operation expects the target database is already
initialized. This change ensures db sync is completed before cron job
is enabled.

Closes-Bug: #1955829
Change-Id: I742ea262bde8b9412627a475c53b27d25e132787
This commit is contained in:
Takashi Kajinami 2021-12-27 22:24:14 +09:00
parent 43105f3130
commit 67139207a9
2 changed files with 9 additions and 10 deletions

View File

@ -79,8 +79,7 @@ class heat::cron::purge_deleted (
hour => $hour,
monthday => $monthday,
month => $month,
weekday => $weekday
weekday => $weekday,
require => Anchor['heat::dbsync::end']
}
Package<| tag == 'heat-package' |> -> Cron['heat-manage purge_deleted']
}

View File

@ -35,9 +35,9 @@ describe 'heat::cron::purge_deleted' do
:hour => params[:hour],
:monthday => params[:monthday],
:month => params[:month],
:weekday => params[:weekday]
:weekday => params[:weekday],
:require => 'Anchor[heat::dbsync::end]'
)
is_expected.to contain_package('heat-common').that_comes_before('Cron[heat-manage purge_deleted]')
end
end
@ -58,9 +58,9 @@ describe 'heat::cron::purge_deleted' do
:hour => params[:hour],
:monthday => params[:monthday],
:month => params[:month],
:weekday => params[:weekday]
:weekday => params[:weekday],
:require => 'Anchor[heat::dbsync::end]'
)
is_expected.to contain_package('heat-common').that_comes_before('Cron[heat-manage purge_deleted]')
end
end
@ -71,7 +71,7 @@ describe 'heat::cron::purge_deleted' do
)
end
it 'configures a cron with delay' do
it 'disables the cron job' do
is_expected.to contain_cron('heat-manage purge_deleted').with(
:ensure => params[:ensure],
:command => "heat-manage purge_deleted -g days 1 >>#{params[:destination]} 2>&1",
@ -81,9 +81,9 @@ describe 'heat::cron::purge_deleted' do
:hour => params[:hour],
:monthday => params[:monthday],
:month => params[:month],
:weekday => params[:weekday]
:weekday => params[:weekday],
:require => 'Anchor[heat::dbsync::end]'
)
is_expected.to contain_package('heat-common').that_comes_before('Cron[heat-manage purge_deleted]')
end
end