Fixed issue with rabbit_hosts parameter

We should initialize rabbit_hosts parameter with array,
not with string or boolen value.

Change-Id: Iab51d77c35fb78f70060115e0ca48238f6f9de50
Closes-Bug: #1470054
This commit is contained in:
Timur Nurlygayanov
2015-06-30 13:45:31 +03:00
committed by Sebastien Badia
parent be0b9ac1a3
commit 5e190fcb82
3 changed files with 16 additions and 4 deletions

View File

@@ -46,7 +46,7 @@
#
# [*rabbit_hosts*]
# (optional) List of clustered rabbit servers.
# Defaults to false
# Defaults to undef
#
# [*rabbit_port*]
# (optional) Port for rabbitmq instance.
@@ -276,7 +276,7 @@ class nova(
$glance_api_servers = 'localhost:9292',
$memcached_servers = false,
$rabbit_host = 'localhost',
$rabbit_hosts = false,
$rabbit_hosts = undef,
$rabbit_password = 'guest',
$rabbit_port = '5672',
$rabbit_userid = 'guest',
@@ -526,6 +526,7 @@ class nova(
nova_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
nova_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
}
if $rabbit_ha_queues == undef {
if $rabbit_hosts {
nova_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }

View File

@@ -41,7 +41,7 @@
#
# [*rabbit_hosts*]
# (optional) Address of the message broker in this cell
# Defaults to 'localhost'
# Defaults to ['localhost']
#
# [*rabbit_port*]
# (optional) Port number of the message broker in this cell
@@ -64,7 +64,7 @@ define nova::manage::cells (
$cell_parent_name = undef,
$rabbit_username = 'guest',
$rabbit_password = 'guest',
$rabbit_hosts = 'localhost',
$rabbit_hosts = ['localhost'],
$rabbit_port = '5672',
$rabbit_virtual_host = '/',
$weight_offset = '1.0',

View File

@@ -269,6 +269,17 @@ describe 'nova' do
end
end
context 'with rabbit_ha_queues set to false and with rabbit_hosts' do
let :params do
{ :rabbit_ha_queues => 'false',
:rabbit_hosts => ['rabbit:5673'] }
end
it 'configures rabbit' do
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(false)
end
end
context 'with amqp_durable_queues parameter' do
let :params do
{ :rabbit_hosts => ['rabbit:5673'],