diff --git a/manifests/cron/purge_deleted.pp b/manifests/cron/purge_deleted.pp index e86e5df7..210cc093 100644 --- a/manifests/cron/purge_deleted.pp +++ b/manifests/cron/purge_deleted.pp @@ -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'] } diff --git a/spec/classes/heat_cron_purge_deleted_spec.rb b/spec/classes/heat_cron_purge_deleted_spec.rb index 9cca71da..f228e1cf 100644 --- a/spec/classes/heat_cron_purge_deleted_spec.rb +++ b/spec/classes/heat_cron_purge_deleted_spec.rb @@ -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