From fe9acf1d3e8aba50cae5c0dea84d55ea60376eba Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Thu, 26 Mar 2015 15:42:35 -0500 Subject: [PATCH] Use identity_uri_transform for identiry_uri support Remove deprecated keys and use identity_uri via the new transform helper method. Change-Id: Ibd21f81607f5ef1b02e07e4da3e5ea306f7d6f8b Implements: blueprint identity-uri --- recipes/common.rb | 3 ++- spec/common_spec.rb | 26 ++++---------------------- templates/default/ceilometer.conf.erb | 4 +--- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/recipes/common.rb b/recipes/common.rb index e8e8f58..e241f96 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -67,6 +67,7 @@ image_endpoint = internal_endpoint 'image-api' telemetry_api_bind = endpoint 'telemetry-api-bind' auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['telemetry']['api']['auth']['version'] +identity_uri = identity_uri_transform(identity_admin_endpoint) Chef::Log.debug("openstack-telemetry::common:service_user|#{service_user}") Chef::Log.debug("openstack-telemetry::common:service_tenant|#{service_tenant}") @@ -94,10 +95,10 @@ template node['openstack']['telemetry']['conf'] do variables( auth_uri: auth_uri, + identity_uri: identity_uri, database_connection: db_uri, image_endpoint: image_endpoint, identity_endpoint: identity_endpoint, - identity_admin_endpoint: identity_admin_endpoint, mq_service_type: mq_service_type, mq_password: mq_password, rabbit_hosts: rabbit_hosts, diff --git a/spec/common_spec.rb b/spec/common_spec.rb index 2041df0..ca6179f 100644 --- a/spec/common_spec.rb +++ b/spec/common_spec.rb @@ -96,11 +96,7 @@ describe 'openstack-telemetry::common' do /^rabbit_port = 5672$/, /^rabbit_host = 127.0.0.1$/, /^rabbit_virtual_host = \/$/, - /^rabbit_use_ssl = false$/, - %r{^auth_uri = http://127.0.0.1:5000/v2.0$}, - /^auth_host = 127.0.0.1$/, - /^auth_port = 35357$/, - /^auth_protocol = http$/ + /^rabbit_use_ssl = false$/ ].each do |line| expect(chef_run).to render_file(file.name).with_content(line) end @@ -126,11 +122,7 @@ describe 'openstack-telemetry::common' do /^rabbit_hosts = 1.1.1.1:5672,2.2.2.2:5672$/, /^rabbit_ha_queues = True$/, /^rabbit_virtual_host = \/$/, - /^rabbit_use_ssl = false$/, - %r{^auth_uri = http://127.0.0.1:5000/v2.0$}, - /^auth_host = 127.0.0.1$/, - /^auth_port = 35357$/, - /^auth_protocol = http$/ + /^rabbit_use_ssl = false$/ ].each do |line| expect(chef_run).to render_file(file.name).with_content(line) end @@ -243,19 +235,9 @@ describe 'openstack-telemetry::common' do /^#{Regexp.quote('auth_uri = http://127.0.0.1:5000/v2.0')}$/) end - it 'has auth_host' do + it 'has identity_uri' do expect(chef_run).to render_file(file.name).with_content( - /^#{Regexp.quote('auth_host = 127.0.0.1')}$/) - end - - it 'has auth_port' do - expect(chef_run).to render_file(file.name).with_content( - /^auth_port = 35357$/) - end - - it 'has auth_protocol' do - expect(chef_run).to render_file(file.name).with_content( - /^auth_protocol = http$/) + /^#{Regexp.quote('identity_uri = http://127.0.0.1:35357/')}$/) end it 'has no auth_version' do diff --git a/templates/default/ceilometer.conf.erb b/templates/default/ceilometer.conf.erb index aa52209..3b07f8c 100644 --- a/templates/default/ceilometer.conf.erb +++ b/templates/default/ceilometer.conf.erb @@ -72,9 +72,7 @@ port = <%= @api_bind_port %> [keystone_authtoken] auth_uri = <%= @auth_uri %> -auth_host = <%= @identity_admin_endpoint.host %> -auth_port = <%= @identity_admin_endpoint.port %> -auth_protocol = <%= @identity_admin_endpoint.scheme %> +identity_uri = <%= @identity_uri %> <% if node['openstack']['telemetry']['api']['auth']['version'] != 'v2.0' %> auth_version = <%= node['openstack']['telemetry']['api']['auth']['version'] %> <% end %>