Fix until_complete parameter in nova crons

The until_complete paramenter needs to be translated
correctly to the CLI option --until-complete instead of
--until_complete.

Change-Id: Ib5b32d02292e7d9b2f6985544e7d9e3f51f979b5
Closes-Bug: 1745120
This commit is contained in:
Carlos Camacho
2018-01-24 10:06:43 +01:00
parent c5771feb7c
commit 7a1931cd63
2 changed files with 3 additions and 3 deletions

View File

@@ -51,7 +51,7 @@
# Defaults to '/var/log/nova/nova-rowsflush.log'.
#
# [*until_complete*]
# (optional) Adds --until_complete to the archive command
# (optional) Adds --until-complete to the archive command
# Defaults to false.
#
class nova::cron::archive_deleted_rows (
@@ -70,7 +70,7 @@ class nova::cron::archive_deleted_rows (
include ::nova::params
if $until_complete {
$until_complete_real = '--until_complete'
$until_complete_real = '--until-complete'
}
cron { 'nova-manage db archive_deleted_rows':

View File

@@ -44,7 +44,7 @@ describe 'nova::cron::archive_deleted_rows' do
it 'configures a cron with until_complete' do
is_expected.to contain_cron('nova-manage db archive_deleted_rows').with(
:command => "nova-manage db archive_deleted_rows --max_rows #{params[:max_rows]} --until_complete >>#{params[:destination]} 2>&1",
:command => "nova-manage db archive_deleted_rows --max_rows #{params[:max_rows]} --until-complete >>#{params[:destination]} 2>&1",
:user => 'nova',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => params[:user],