RPC_backend / transport_url workover

- removed deprecated rabbitmq attributes
- added rabbit_transport_url

Change-Id: Id1fa34e55c556ffae2a6200bb7138f11808a3abf
This commit is contained in:
Christoph Albers 2016-12-16 17:36:54 +01:00 committed by Jan Klare
parent 5943b3b5b3
commit e00cf744d2
2 changed files with 8 additions and 12 deletions

View File

@ -44,14 +44,8 @@ node['openstack']['db']['python_packages'][db_type].each do |pkg|
end
end
unless node['openstack']['orchestration']['conf']['DEFAULT']['rpc_backend'].nil? &&
node['openstack']['orchestration']['conf']['DEFAULT']['rpc_backend'] == 'rabbit'
user = node['openstack']['mq']['orchestration']['rabbit']['userid']
node.default['openstack']['orchestration']['conf']
.[]('oslo_messaging_rabbit')['rabbit_userid'] = user
node.default['openstack']['orchestration']['conf_secrets']
.[]('oslo_messaging_rabbit')['rabbit_password'] =
get_password 'user', user
if node['openstack']['mq']['service_type'] == 'rabbit'
node.default['openstack']['orchestration']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'orchestration'
end
db_user = node['openstack']['db']['orchestration']['username']

View File

@ -52,6 +52,9 @@ shared_context 'orchestration_stubs' do
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('token', 'orchestration_auth_encryption_key')
.and_return 'auth_encryption_key_secret'
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
.with('orchestration')
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
allow(Chef::Application).to receive(:fatal!)
end
end
@ -187,12 +190,11 @@ shared_examples 'expects to create heat conf' do
end
describe 'has oslo_messaging_rabbit values' do
it 'has default oslo_messaging_rabbit values' do
it 'has default rabbit values' do
[
/^rabbit_userid = guest$/,
/^rabbit_password = mq-pass$/
%r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$}
].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line)
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
end
end
end