From 0d6cffad4eb92476df3fa75057f0f3e4c7708720 Mon Sep 17 00:00:00 2001 From: Christoph Albers Date: Fri, 12 Feb 2016 18:55:33 +0100 Subject: [PATCH] invert the order of endpoint and bind_service attributes * endpoint type (admin, internal, public) and service (identitiy, network etc.) was switched during refactoring, this patch reverts this unintended switching * edited bind_service service type from public,internal,admin to 'all' for default binding to just one service Change-Id: I4d28b1b2489419c1f033dfcda0effa5a53c537c3 Depends-On: Iec485deaf415e4187a323435cce2b6bbadfc5d42 Depends-On: Ia5bddfc5e2fd77cd6e9e855c680b079f78fc1c3f Depends-On: I4f97b659361dabd7fac216305d2aad2f1bb98f51 --- attributes/default.rb | 13 ++++++------- recipes/cinder-common.rb | 2 +- spec/identity_registration_spec.rb | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 0dc961c..8fb12f0 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -124,14 +124,13 @@ end # The OpenStack Volume (Cinder) API endpoint %w(public internal admin).each do |ep_type| - default['openstack']['endpoints']['block-storage'][ep_type]['scheme'] = 'http' - default['openstack']['endpoints']['block-storage'][ep_type]['path'] = '/v2/%(tenant_id)s' - %w(endpoints bind_service).each do |type| - default['openstack'][type]['block-storage'][ep_type]['host'] = '127.0.0.1' - default['openstack'][type]['block-storage'][ep_type]['port'] = '8776' - end + default['openstack']['endpoints'][ep_type]['block-storage']['scheme'] = 'http' + default['openstack']['endpoints'][ep_type]['block-storage']['path'] = '/v2/%(tenant_id)s' + default['openstack']['endpoints'][ep_type]['block-storage']['host'] = '127.0.0.1' + default['openstack']['endpoints'][ep_type]['block-storage']['port'] = '8776' end - +default['openstack']['bind_service']['all']['block-storage']['host'] = '127.0.0.1' +default['openstack']['bind_service']['all']['block-storage']['port'] = '8776' # ============================= rootwrap Configuration =================== # use cinder root wrap default['openstack']['block-storage']['use_rootwrap'] = true diff --git a/recipes/cinder-common.rb b/recipes/cinder-common.rb index f988341..8890bcf 100644 --- a/recipes/cinder-common.rb +++ b/recipes/cinder-common.rb @@ -51,7 +51,7 @@ if node['openstack']['block-storage']['conf']['DEFAULT']['rpc_backend'] == 'rabb end glance_api_endpoint = internal_endpoint 'image_api' -cinder_api_bind = node['openstack']['bind_service']['block-storage']['public'] +cinder_api_bind = node['openstack']['bind_service']['all']['block-storage'] identity_endpoint = public_endpoint 'identity' node.default['openstack']['block-storage']['conf_secrets'] .[]('keystone_authtoken')['password'] = diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 2901afd..35b79ea 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -61,9 +61,9 @@ describe 'openstack-block-storage::identity_registration' do internal_url = 'http://internal.host:456/internal_path' public_url = 'https://public.host:789/public_path' - node.set['openstack']['endpoints']['block-storage']['internal']['uri'] = internal_url - node.set['openstack']['endpoints']['block-storage']['admin']['uri'] = admin_url - node.set['openstack']['endpoints']['block-storage']['public']['uri'] = public_url + node.set['openstack']['endpoints']['internal']['block-storage']['uri'] = internal_url + node.set['openstack']['endpoints']['admin']['block-storage']['uri'] = admin_url + node.set['openstack']['endpoints']['public']['block-storage']['uri'] = public_url expect(chef_run).to create_endpoint_openstack_identity_register( 'Register Cinder V2 Volume Endpoint'