Merge pull request #354 from enovance/bug/352/emilien

Fix Neutron-db-sync process
This commit is contained in:
Emilien Macchi
2014-03-10 12:36:37 +01:00
2 changed files with 7 additions and 2 deletions

View File

@@ -45,9 +45,12 @@ class cloud::network::controller(
# Note(EmilienM):
# We check if DB tables are created, if not we populate Neutron DB.
# It's a hack to fit with our setup where we run MySQL/Galera
Neutron_config<| |> ->
exec {'neutron_db_sync':
command => '/usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head',
unless => "/usr/bin/mysql neutron -h ${neutron_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
unless => "/usr/bin/mysql neutron -h ${neutron_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables",
require => 'Neutron_config[DEFAULT/service_plugins]',
notify => Service['neutron-server']
}
@@haproxy::balancermember{"${::fqdn}-neutron_api":

View File

@@ -91,7 +91,9 @@ describe 'cloud::network::controller' do
it 'checks if Neutron DB is populated' do
should contain_exec('neutron_db_sync').with(
:command => '/usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head',
:unless => '/usr/bin/mysql neutron -h 10.0.0.1 -u neutron -psecrete -e "show tables" | /bin/grep Tables'
:unless => '/usr/bin/mysql neutron -h 10.0.0.1 -u neutron -psecrete -e "show tables" | /bin/grep Tables',
:require => 'Neutron_config[DEFAULT/service_plugins]',
:notify => 'Service[neutron-server]'
)
end