Merge "Enable cell_v2 setup by default"

This commit is contained in:
Jenkins
2017-01-04 13:34:37 +00:00
committed by Gerrit Code Review
5 changed files with 42 additions and 21 deletions

View File

@@ -32,9 +32,8 @@
# Defaults to undef # Defaults to undef
# #
# [*setup_cell0*] # [*setup_cell0*]
# (optional) Setup a cell0 for the cell_v2 functionality. This option will # (optional) Setup a cell0 for the cell_v2 functionality.
# be set to true by default in Ocata when the cell v2 setup is mandatory. # Defaults to true
# Defaults to false
# #
class nova::db::mysql_api( class nova::db::mysql_api(
$password, $password,
@@ -44,7 +43,7 @@ class nova::db::mysql_api(
$charset = 'utf8', $charset = 'utf8',
$collate = 'utf8_general_ci', $collate = 'utf8_general_ci',
$allowed_hosts = undef, $allowed_hosts = undef,
$setup_cell0 = false, $setup_cell0 = true,
) { ) {
include ::nova::deps include ::nova::deps

View File

@@ -11,13 +11,12 @@
# #
# [*cellv2_setup*] # [*cellv2_setup*]
# (optional) This flag toggles if we run the cell_v2 simple_cell_setup action # (optional) This flag toggles if we run the cell_v2 simple_cell_setup action
# with nova-manage. This flag will be set to true in Ocata when the cell v2 # with nova-manage.
# setup is mandatory. # Defaults to true.
# Defaults to false.
# #
class nova::db::sync_api( class nova::db::sync_api(
$extra_params = undef, $extra_params = undef,
$cellv2_setup = false, $cellv2_setup = true,
) { ) {
include ::nova::deps include ::nova::deps

View File

@@ -0,0 +1,6 @@
---
upgrade:
- The cell_v2 setup has been enabled by default. To skip it or
prevent it from running, set nova::db::mysql_api::setup_cell0 and
nova::db::sync_api::cellv2_setup to false.
as the prelude. This may mean repeating some details.

View File

@@ -23,7 +23,13 @@ describe 'nova::db::mysql_api' do
:collate => 'utf8_general_ci', :collate => 'utf8_general_ci',
)} )}
it { is_expected.to_not contain_openstacklib__db__mysql('nova_api_cell0') } it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with(
:user => 'nova_api',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:create_user => false,
)}
end end
context 'overriding allowed_hosts param to array' do context 'overriding allowed_hosts param to array' do
@@ -40,6 +46,13 @@ describe 'nova::db::mysql_api' do
:collate => 'utf8_general_ci', :collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%'], :allowed_hosts => ['127.0.0.1','%'],
)} )}
it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with(
:user => 'nova_api',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%'],
)}
end end
context 'overriding allowed_hosts param to string' do context 'overriding allowed_hosts param to string' do
@@ -56,6 +69,13 @@ describe 'nova::db::mysql_api' do
:collate => 'utf8_general_ci', :collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1', :allowed_hosts => '192.168.1.1',
)} )}
it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with(
:user => 'nova_api',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1',
)}
end end
context 'when overriding charset' do context 'when overriding charset' do
@@ -68,22 +88,19 @@ describe 'nova::db::mysql_api' do
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with( it { is_expected.to contain_openstacklib__db__mysql('nova_api').with(
:charset => 'latin1', :charset => 'latin1',
)} )}
end
context 'when enabling cell0 setup' do
let :params do
{ :setup_cell0 => true }.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with(
:user => 'nova_api', :charset => 'latin1',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:create_user => false,
)} )}
end end
context 'when disabling cell0 setup' do
let :params do
{ :setup_cell0 => false }.merge(required_params)
end
it { is_expected.to_not contain_openstacklib__db__mysql('nova_api_cell0') }
end
end end
on_supported_os({ on_supported_os({

View File

@@ -15,14 +15,14 @@ describe 'nova::db::sync_api' do
:notify => 'Anchor[nova::dbsync_api::end]', :notify => 'Anchor[nova::dbsync_api::end]',
) )
} }
it { is_expected.to_not contain_class('nova::db::sync_cell_v2') } it { is_expected.to contain_class('nova::db::sync_cell_v2') }
end end
context "overriding extra_params" do context "overriding extra_params" do
let :params do let :params do
{ {
:extra_params => '--config-file /etc/nova/nova.conf', :extra_params => '--config-file /etc/nova/nova.conf',
:cellv2_setup => true :cellv2_setup => false
} }
end end
@@ -37,7 +37,7 @@ describe 'nova::db::sync_api' do
:notify => 'Anchor[nova::dbsync_api::end]', :notify => 'Anchor[nova::dbsync_api::end]',
) )
} }
it { is_expected.to contain_class('nova::db::sync_cell_v2') } it { is_expected.to_not contain_class('nova::db::sync_cell_v2') }
end end
end end