Update glance::notify::rabbitmq options
This patch is aim to update rabbitmq options in notify::rabbitmq class to keep consistent with glance-api.conf. And fix description error in comment. Fixes bug #1221008 Change-Id: I441a61bb683552e1696f779c733db561cca03b64
This commit is contained in:
parent
a1b2406c9c
commit
e2fef179c1
@ -1,16 +1,28 @@
|
||||
#
|
||||
# used to configure qpid notifications for glance
|
||||
# used to configure rabbitmq notifications for glance
|
||||
#
|
||||
class glance::notify::rabbitmq(
|
||||
$rabbit_password,
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_host = 'localhost'
|
||||
) inherits glance::api {
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_host = 'localhost',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_virtual_host = '/',
|
||||
$rabbit_use_ssl = false,
|
||||
$rabbit_notification_exchange = 'glance',
|
||||
$rabbit_notification_topic = 'notifications',
|
||||
$rabbit_durable_queues = false
|
||||
) {
|
||||
|
||||
glance_api_config {
|
||||
'DEFAULT/notifier_strategy': value => 'rabbit';
|
||||
'DEFAULT/rabbit_host': value => $rabbit_host;
|
||||
'DEFAULT/rabbit_password': value => $rabbit_password;
|
||||
'DEFAULT/rabbit_userid': value => $rabbit_userid;
|
||||
'DEFAULT/notifier_strategy': value => 'rabbit';
|
||||
'DEFAULT/rabbit_host': value => $rabbit_host;
|
||||
'DEFAULT/rabbit_port': value => $rabbit_port;
|
||||
'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||
'DEFAULT/rabbit_password': value => $rabbit_password;
|
||||
'DEFAULT/rabbit_userid': value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_notification_exchange': value => $rabbit_notification_exchange;
|
||||
'DEFAULT/rabbit_notification_topic': value => $rabbit_notification_topic;
|
||||
'DEFAULT/rabbit_use_ssl': value => $rabbit_use_ssl;
|
||||
'DEFAULT/rabbit_durable_queues': value => $rabbit_durable_queues;
|
||||
}
|
||||
}
|
||||
|
@ -18,16 +18,26 @@ describe 'glance::notify::rabbitmq' do
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_password').with_value('pass') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_userid').with_value('guest') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_host').with_value('localhost') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_port').with_value('5672') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_virtual_host').with_value('/') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_notification_exchange').with_value('glance') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_notification_topic').with_value('notifications') }
|
||||
|
||||
describe 'when passing params' do
|
||||
let :params do
|
||||
{
|
||||
:rabbit_password => 'pass',
|
||||
:rabbit_userid => 'guest2',
|
||||
:rabbit_host => 'localhost2',
|
||||
:rabbit_password => 'pass',
|
||||
:rabbit_userid => 'guest2',
|
||||
:rabbit_host => 'localhost2',
|
||||
:rabbit_port => '5673',
|
||||
:rabbit_use_ssl => true,
|
||||
:rabbit_durable_queues => true,
|
||||
}
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_userid').with_value('guest2') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_host').with_value('localhost2') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_port').with_value('5673') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_use_ssl').with_value('true') }
|
||||
it { should contain_glance_api_config('DEFAULT/rabbit_durable_queues').with_value('true') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user