Browse Source

Deprecate auth_uri option

Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]https://review.openstack.org/#/c/508522/

Change-Id: I4494127d11456a237af33cc969bde2dae081ce9c
Depends-On: I4c82a63baabd6b9304b302c97cd751a0103d8316
Depends-On: I1bb3489acf1f591eefbad91bdbb666b21a53238a
Closes-Bug: #1759098
tags/3.1.0
ZhongShengping 1 year ago
parent
commit
e6fc31d0ad

+ 16
- 3
manifests/keystone/authtoken.pp View File

@@ -41,7 +41,7 @@
41 41
 #   (Optional) Authentication type to load
42 42
 #   Defaults to 'password'
43 43
 #
44
-# [*auth_uri*]
44
+# [*www_authenticate_uri*]
45 45
 #   (Optional) Complete public Identity API endpoint.
46 46
 #   Defaults to 'http://localhost:5000'.
47 47
 #
@@ -177,6 +177,12 @@
177 177
 #   (in seconds). Set to -1 to disable caching completely. Integer value
178 178
 #   Defaults to $::os_service_default.
179 179
 #
180
+# DEPRECATED PARAMETERS
181
+#
182
+# [*auth_uri*]
183
+#   (Optional) Complete public Identity API endpoint.
184
+#   Defaults to undef
185
+#
180 186
 class vitrage::keystone::authtoken(
181 187
   $password,
182 188
   $username                       = 'vitrage',
@@ -187,7 +193,7 @@ class vitrage::keystone::authtoken(
187 193
   $insecure                       = $::os_service_default,
188 194
   $auth_section                   = $::os_service_default,
189 195
   $auth_type                      = 'password',
190
-  $auth_uri                       = 'http://localhost:5000',
196
+  $www_authenticate_uri                       = 'http://localhost:5000',
191 197
   $auth_version                   = $::os_service_default,
192 198
   $cache                          = $::os_service_default,
193 199
   $cafile                         = $::os_service_default,
@@ -212,16 +218,23 @@ class vitrage::keystone::authtoken(
212 218
   $manage_memcache_package        = false,
213 219
   $region_name                    = $::os_service_default,
214 220
   $token_cache_time               = $::os_service_default,
221
+  # DEPRECATED PARAMETERS
222
+  $auth_uri                       = undef,
215 223
 ) {
216 224
 
217 225
   include ::vitrage::deps
218 226
 
227
+  if $auth_uri {
228
+    warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.')
229
+  }
230
+  $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri)
231
+
219 232
   keystone::resource::authtoken { 'vitrage_config':
220 233
     username                       => $username,
221 234
     password                       => $password,
222 235
     project_name                   => $project_name,
223 236
     auth_url                       => $auth_url,
224
-    auth_uri                       => $auth_uri,
237
+    www_authenticate_uri           => $www_authenticate_uri_real,
225 238
     auth_version                   => $auth_version,
226 239
     auth_type                      => $auth_type,
227 240
     auth_section                   => $auth_section,

+ 4
- 0
releasenotes/notes/deprecate_auth_uri_parameter-8c906f4509fae5fd.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+deprecations:
3
+  - auth_uri is deprecated and will be removed in a future release.
4
+    Please use www_authenticate_uri instead.

+ 3
- 3
spec/classes/vitrage_keystone_authtoken_spec.rb View File

@@ -25,7 +25,7 @@ describe 'vitrage::keystone::authtoken' do
25 25
         is_expected.to contain_vitrage_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
26 26
         is_expected.to contain_vitrage_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
27 27
         is_expected.to contain_vitrage_config('keystone_authtoken/auth_type').with_value('password')
28
-        is_expected.to contain_vitrage_config('keystone_authtoken/auth_uri').with_value('http://localhost:5000')
28
+        is_expected.to contain_vitrage_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000')
29 29
         is_expected.to contain_vitrage_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
30 30
         is_expected.to contain_vitrage_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
31 31
         is_expected.to contain_vitrage_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
@@ -55,7 +55,7 @@ describe 'vitrage::keystone::authtoken' do
55 55
     context 'when overriding parameters' do
56 56
       before do
57 57
         params.merge!({
58
-          :auth_uri                             => 'https://10.0.0.1:9999/',
58
+          :www_authenticate_uri                 => 'https://10.0.0.1:9999/',
59 59
           :username                             => 'myuser',
60 60
           :password                             => 'mypasswd',
61 61
           :auth_url                             => 'https://127.0.0.1:35357',
@@ -93,7 +93,7 @@ describe 'vitrage::keystone::authtoken' do
93 93
       end
94 94
 
95 95
       it 'configure keystone_authtoken' do
96
-        is_expected.to contain_vitrage_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
96
+        is_expected.to contain_vitrage_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
97 97
         is_expected.to contain_vitrage_config('keystone_authtoken/username').with_value(params[:username])
98 98
         is_expected.to contain_vitrage_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
99 99
         is_expected.to contain_vitrage_config('keystone_authtoken/auth_url').with_value(params[:auth_url])

Loading…
Cancel
Save