Creating qpid_sasl_mechanisms parameter
Accepts a string or array. Change-Id: Iaa4a68a7aace39f516ead63703528e46a03794c5
This commit is contained in:
parent
cddbbbde52
commit
30250b4db5
@ -28,6 +28,7 @@ class cinder (
|
||||
$qpid_port = '5672',
|
||||
$qpid_username = 'guest',
|
||||
$qpid_password = false,
|
||||
$qpid_sasl_mechanisms = false,
|
||||
$qpid_reconnect = true,
|
||||
$qpid_reconnect_timeout = 0,
|
||||
$qpid_reconnect_limit = 0,
|
||||
@ -121,6 +122,20 @@ class cinder (
|
||||
'DEFAULT/qpid_protocol': value => $qpid_protocol;
|
||||
'DEFAULT/qpid_tcp_nodelay': value => $qpid_tcp_nodelay;
|
||||
}
|
||||
|
||||
if is_array($qpid_sasl_mechanisms) {
|
||||
cinder_config {
|
||||
'DEFAULT/qpid_sasl_mechanisms': value => join($qpid_sasl_mechanisms, ' ');
|
||||
}
|
||||
} elsif $qpid_sasl_mechanisms {
|
||||
cinder_config {
|
||||
'DEFAULT/qpid_sasl_mechanisms': value => $qpid_sasl_mechanisms;
|
||||
}
|
||||
} else {
|
||||
cinder_config {
|
||||
'DEFAULT/qpid_sasl_mechanisms': ensure => absent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cinder_config {
|
||||
|
@ -136,7 +136,44 @@ describe 'cinder' do
|
||||
it { should contain_cinder_config('DEFAULT/qpid_heartbeat').with_value('60') }
|
||||
it { should contain_cinder_config('DEFAULT/qpid_protocol').with_value('tcp') }
|
||||
it { should contain_cinder_config('DEFAULT/qpid_tcp_nodelay').with_value(true) }
|
||||
end
|
||||
|
||||
describe 'with qpid rpc and no qpid_sasl_mechanisms' do
|
||||
let :params do
|
||||
{
|
||||
:sql_connection => 'mysql://user:password@host/database',
|
||||
:qpid_password => 'guest',
|
||||
:rpc_backend => 'cinder.openstack.common.rpc.impl_qpid'
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') }
|
||||
end
|
||||
|
||||
describe 'with qpid rpc and qpid_sasl_mechanisms string' do
|
||||
let :params do
|
||||
{
|
||||
:sql_connection => 'mysql://user:password@host/database',
|
||||
:qpid_password => 'guest',
|
||||
:qpid_sasl_mechanisms => 'PLAIN',
|
||||
:rpc_backend => 'cinder.openstack.common.rpc.impl_qpid'
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('DEFAULT/qpid_sasl_mechanisms').with_value('PLAIN') }
|
||||
end
|
||||
|
||||
describe 'with qpid rpc and qpid_sasl_mechanisms array' do
|
||||
let :params do
|
||||
{
|
||||
:sql_connection => 'mysql://user:password@host/database',
|
||||
:qpid_password => 'guest',
|
||||
:qpid_sasl_mechanisms => [ 'DIGEST-MD5', 'GSSAPI', 'PLAIN' ],
|
||||
:rpc_backend => 'cinder.openstack.common.rpc.impl_qpid'
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') }
|
||||
end
|
||||
|
||||
describe 'with syslog disabled' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user