Merge "Allow customization of db sync command line"

This commit is contained in:
Jenkins
2015-12-03 19:04:53 +00:00
committed by Gerrit Code Review
2 changed files with 30 additions and 3 deletions

View File

@@ -1,7 +1,17 @@
#
# Class to execute nova dbsync
#
class nova::db::sync {
# ==Parameters
#
# [*extra_params*]
# (optional) String of extra command line parameters to append
# to the nova-manage db sync command. These will be inserted in
# the command line between 'nova-manage' and 'db sync'.
# Defaults to undef
#
class nova::db::sync(
$extra_params = undef,
) {
include ::nova::params
@@ -14,7 +24,7 @@ class nova::db::sync {
Exec<| title == 'post-nova_config' |> ~> Exec['nova-db-sync']
exec { 'nova-db-sync':
command => '/usr/bin/nova-manage db sync',
command => "/usr/bin/nova-manage ${extra_params} db sync",
refreshonly => true,
logoutput => on_failure,
}

View File

@@ -12,8 +12,25 @@ describe 'nova::db::sync' do
)
end
describe "overriding extra_params" do
let :params do
{
:extra_params => '--config-file /etc/nova/nova.conf',
}
end
it {
is_expected.to contain_exec('nova-db-sync').with(
:command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf db sync',
:refreshonly => 'true',
:logoutput => 'on_failure'
)
}
end
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({