Merge "Allow customization of db sync command line"
This commit is contained in:
@@ -1,7 +1,17 @@
|
|||||||
#
|
#
|
||||||
# Class to execute nova dbsync
|
# 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
|
include ::nova::params
|
||||||
|
|
||||||
@@ -14,7 +24,7 @@ class nova::db::sync {
|
|||||||
Exec<| title == 'post-nova_config' |> ~> Exec['nova-db-sync']
|
Exec<| title == 'post-nova_config' |> ~> Exec['nova-db-sync']
|
||||||
|
|
||||||
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,
|
refreshonly => true,
|
||||||
logoutput => on_failure,
|
logoutput => on_failure,
|
||||||
}
|
}
|
||||||
|
@@ -6,14 +6,31 @@ describe 'nova::db::sync' do
|
|||||||
|
|
||||||
it 'runs nova-db-sync' do
|
it 'runs nova-db-sync' do
|
||||||
is_expected.to contain_exec('nova-db-sync').with(
|
is_expected.to contain_exec('nova-db-sync').with(
|
||||||
:command => '/usr/bin/nova-manage db sync',
|
:command => '/usr/bin/nova-manage db sync',
|
||||||
:refreshonly => 'true',
|
:refreshonly => 'true',
|
||||||
:logoutput => 'on_failure'
|
:logoutput => 'on_failure'
|
||||||
)
|
)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
context 'on a RedHat osfamily' do
|
context 'on a RedHat osfamily' do
|
||||||
let :facts do
|
let :facts do
|
||||||
@default_facts.merge({
|
@default_facts.merge({
|
||||||
|
Reference in New Issue
Block a user