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: I35fd2cc9b91148ab23793075862483940d92798e
Depends-On: I4c82a63baabd6b9304b302c97cd751a0103d8316
Closes-Bug: #1759098
tags/13.1.0
ZhongShengping 1 year ago
parent
commit
1c23b8e61e

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

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

+ 4
- 0
releasenotes/notes/deprecate_auth_uri_parameter-93fd3119f74b8769.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/watcher_keystone_authtoken_spec.rb View File

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

Loading…
Cancel
Save