Browse Source

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
Christoph Albers 3 years ago
parent
commit
0d6cffad4e
3 changed files with 10 additions and 11 deletions
  1. 6
    7
      attributes/default.rb
  2. 1
    1
      recipes/cinder-common.rb
  3. 3
    3
      spec/identity_registration_spec.rb

+ 6
- 7
attributes/default.rb View File

@@ -124,14 +124,13 @@ end
124 124
 
125 125
 # The OpenStack Volume (Cinder) API endpoint
126 126
 %w(public internal admin).each do |ep_type|
127
-  default['openstack']['endpoints']['block-storage'][ep_type]['scheme'] = 'http'
128
-  default['openstack']['endpoints']['block-storage'][ep_type]['path'] = '/v2/%(tenant_id)s'
129
-  %w(endpoints bind_service).each do |type|
130
-    default['openstack'][type]['block-storage'][ep_type]['host'] = '127.0.0.1'
131
-    default['openstack'][type]['block-storage'][ep_type]['port'] = '8776'
132
-  end
127
+  default['openstack']['endpoints'][ep_type]['block-storage']['scheme'] = 'http'
128
+  default['openstack']['endpoints'][ep_type]['block-storage']['path'] = '/v2/%(tenant_id)s'
129
+  default['openstack']['endpoints'][ep_type]['block-storage']['host'] = '127.0.0.1'
130
+  default['openstack']['endpoints'][ep_type]['block-storage']['port'] = '8776'
133 131
 end
134
-
132
+default['openstack']['bind_service']['all']['block-storage']['host'] = '127.0.0.1'
133
+default['openstack']['bind_service']['all']['block-storage']['port'] = '8776'
135 134
 # ============================= rootwrap Configuration ===================
136 135
 # use cinder root wrap
137 136
 default['openstack']['block-storage']['use_rootwrap'] = true

+ 1
- 1
recipes/cinder-common.rb View File

@@ -51,7 +51,7 @@ if node['openstack']['block-storage']['conf']['DEFAULT']['rpc_backend'] == 'rabb
51 51
 end
52 52
 
53 53
 glance_api_endpoint = internal_endpoint 'image_api'
54
-cinder_api_bind = node['openstack']['bind_service']['block-storage']['public']
54
+cinder_api_bind = node['openstack']['bind_service']['all']['block-storage']
55 55
 identity_endpoint = public_endpoint 'identity'
56 56
 node.default['openstack']['block-storage']['conf_secrets']
57 57
   .[]('keystone_authtoken')['password'] =

+ 3
- 3
spec/identity_registration_spec.rb View File

@@ -61,9 +61,9 @@ describe 'openstack-block-storage::identity_registration' do
61 61
         internal_url = 'http://internal.host:456/internal_path'
62 62
         public_url = 'https://public.host:789/public_path'
63 63
 
64
-        node.set['openstack']['endpoints']['block-storage']['internal']['uri'] = internal_url
65
-        node.set['openstack']['endpoints']['block-storage']['admin']['uri'] = admin_url
66
-        node.set['openstack']['endpoints']['block-storage']['public']['uri'] = public_url
64
+        node.set['openstack']['endpoints']['internal']['block-storage']['uri'] = internal_url
65
+        node.set['openstack']['endpoints']['admin']['block-storage']['uri'] = admin_url
66
+        node.set['openstack']['endpoints']['public']['block-storage']['uri'] = public_url
67 67
 
68 68
         expect(chef_run).to create_endpoint_openstack_identity_register(
69 69
           'Register Cinder V2 Volume Endpoint'

Loading…
Cancel
Save