Decouple sync_db from enabled

We want db_sync to run even though enabled can be set to False.

Change-Id: I6eb3d137173d2542a8083bbca3acf3bee10c5919
Closes-Bug: 1452278
This commit is contained in:
Giulio Fidente 2015-05-06 16:32:05 +02:00
parent edf8c3e175
commit 3c08645ba8
2 changed files with 6 additions and 3 deletions

View File

@ -778,6 +778,8 @@ class keystone(
} else {
$service_ensure = 'stopped'
}
} else {
warning('Execution of db_sync does not depend on $enabled anymore. Please use sync_db instead.')
}
if $service_name == $::keystone::params::service_name {
@ -824,7 +826,7 @@ class keystone(
fail('Invalid service_name. Either keystone/openstack-keystone for running as a standalone service, or httpd for being run by a httpd server')
}
if $enabled and $sync_db {
if $sync_db {
include ::keystone::db::sync
Class['::keystone::db::sync'] ~> Service[$service_name]
}

View File

@ -56,6 +56,7 @@ describe 'keystone' do
'rabbit_userid' => 'guest',
'admin_workers' => 20,
'public_workers' => 20,
'sync_db' => true,
}
override_params = {
@ -132,8 +133,8 @@ describe 'keystone' do
end
end
it 'should only synchronize the db if $enabled is true' do
if param_hash['enabled']
it 'should synchronize the db if $sync_db is true' do
if param_hash['sync_db']
is_expected.to contain_exec('keystone-manage db_sync').with(
:user => 'keystone',
:refreshonly => true,