RPC_backend / transport_url workover

- removed deprecated rabbitmq attributes
- added rabbit_transport_url

Change-Id: Iafb0c0644d4e9462aca0ee140aa0d06fa18e5f3e
This commit is contained in:
Christoph Albers 2016-12-16 17:48:37 +01:00
parent dd8c23b596
commit 948cf7a4b3
5 changed files with 7 additions and 13 deletions

View File

@ -2,7 +2,6 @@ default['openstack']['telemetry']['conf_secrets'] = {}
default['openstack']['telemetry']['conf'].tap do |conf| default['openstack']['telemetry']['conf'].tap do |conf|
# [DEFAULT] section # [DEFAULT] section
conf['DEFAULT']['rpc_backend'] = node['openstack']['mq']['service_type']
conf['DEFAULT']['meter_dispatchers'] = 'gnocchi' conf['DEFAULT']['meter_dispatchers'] = 'gnocchi'
# [keystone_authtoken] section # [keystone_authtoken] section
conf['keystone_authtoken']['username'] = 'ceilometer' conf['keystone_authtoken']['username'] = 'ceilometer'

View File

@ -1,8 +1,6 @@
default['openstack']['telemetry-metric']['conf_secrets'] = {} default['openstack']['telemetry-metric']['conf_secrets'] = {}
default['openstack']['telemetry-metric']['conf'].tap do |conf| default['openstack']['telemetry-metric']['conf'].tap do |conf|
# [DEFAULT] section
conf['DEFAULT']['rpc_backend'] = node['openstack']['mq']['service_type']
# [keystone_authtoken] section # [keystone_authtoken] section
conf['keystone_authtoken']['username'] = 'gnocchi' conf['keystone_authtoken']['username'] = 'gnocchi'
conf['keystone_authtoken']['project_name'] = 'service' conf['keystone_authtoken']['project_name'] = 'service'

View File

@ -44,13 +44,8 @@ platform['common_packages'].each do |pkg|
end end
end end
if node['openstack']['telemetry']['conf']['DEFAULT']['rpc_backend'] == 'rabbit' if node['openstack']['mq']['service_type'] == 'rabbit'
user = node['openstack']['mq']['telemetry']['rabbit']['userid'] node.default['openstack']['telemetry']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'telemetry'
node.default['openstack']['telemetry']['conf_secrets']
.[]('oslo_messaging_rabbit')['rabbit_userid'] = user
node.default['openstack']['telemetry']['conf_secrets']
.[]('oslo_messaging_rabbit')['rabbit_password'] =
get_password 'user', user
end end
db_user = node['openstack']['db']['telemetry']['username'] db_user = node['openstack']['db']['telemetry']['username']

View File

@ -116,11 +116,10 @@ describe 'openstack-telemetry::common' do
it do it do
[ [
/^rabbit_userid = guest$/, %r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$}
/^rabbit_password = mq-pass$/
].each do |line| ].each do |line|
expect(chef_run).to render_config_file(file.name) expect(chef_run).to render_config_file(file.name)
.with_section_content('oslo_messaging_rabbit', line) .with_section_content('DEFAULT', line)
end end
end end

View File

@ -41,6 +41,9 @@ shared_context 'telemetry-stubs' do
allow_any_instance_of(Chef::Recipe).to receive(:get_password) allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('user', 'admin') .with('user', 'admin')
.and_return('admin-pass') .and_return('admin-pass')
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
.with('telemetry')
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
allow(Chef::Application).to receive(:fatal!) allow(Chef::Application).to receive(:fatal!)
stub_command('/usr/sbin/apache2 -t') stub_command('/usr/sbin/apache2 -t')
stub_command('/usr/sbin/httpd -t') stub_command('/usr/sbin/httpd -t')