ceilometer: escape % in crontab

% in cron is a reserved character and must be escape.

Change-Id: Ic5c4a6126f42c700a8534c3c4d30f5951e4718ae
Closes-bug: #1790503
(cherry picked from commit 10074cd598)
This commit is contained in:
Mehdi Abaakouk 2018-09-03 17:01:45 +02:00 committed by Pradeep Kilambi
parent 148347b2d0
commit c6f8f9bf4a
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class tripleo::profile::base::ceilometer::expirer (
if $step >= 4 {
include ::ceilometer::expirer
Cron <| title == 'ceilometer-expirer' |>
{ command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
{ command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) \\% 86400)) && ${::ceilometer::params::expirer_command}" }
}
}

View File

@ -39,7 +39,7 @@ describe 'tripleo::profile::base::ceilometer::expirer' do
it 'should trigger complete configuration' do
is_expected.to contain_class('ceilometer::expirer')
is_expected.to contain_cron('ceilometer-expirer').with(
:command => 'sleep $(($(od -A n -t d -N 3 /dev/urandom) % 86400)) && ceilometer-expirer'
:command => 'sleep $(($(od -A n -t d -N 3 /dev/urandom) \\% 86400)) && ceilometer-expirer'
)
end
end