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

+ 2
- 2
lib/puppet/provider/trove.rb View File

@@ -26,7 +26,7 @@ class Puppet::Provider::Trove < Puppet::Provider
26 26
   end
27 27
 
28 28
   def self.get_trove_credentials
29
-    auth_keys = ['auth_uri', 'project_name', 'username', 'password',
29
+    auth_keys = ['www_authenticate_uri', 'project_name', 'username', 'password',
30 30
                  'project_domain_name', 'user_domain_name']
31 31
     conf = trove_conf
32 32
     if conf and conf['keystone_authtoken'] and
@@ -54,7 +54,7 @@ correctly configured.")
54 54
   def self.auth_trove(*args)
55 55
     q = trove_credentials
56 56
     authenv = {
57
-      :OS_AUTH_URL            => q['auth_uri'],
57
+      :OS_AUTH_URL            => q['www_authenticate_uri'],
58 58
       :OS_USERNAME            => q['username'],
59 59
       :OS_PROJECT_NAME        => q['project_name'],
60 60
       :OS_PASSWORD            => q['password'],

+ 3
- 1
manifests/api.pp View File

@@ -188,7 +188,9 @@ class trove::api(
188 188
   if $auth_strategy == 'keystone' {
189 189
     include ::trove::keystone::authtoken
190 190
 
191
-    $trove_auth_url = "${regsubst($::trove::keystone::authtoken::auth_uri, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
191
+    # TODO(tobasco): Remove pick when deprecated auth_url is removed and only use www_authenticate_url
192
+    $trove_auth_url_pick = pick($::trove::keystone::authtoken::auth_uri, $::trove::keystone::authtoken::www_authenticate_uri)
193
+    $trove_auth_url = "${regsubst($trove_auth_url_pick, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
192 194
     trove_config {
193 195
       'DEFAULT/trove_auth_url' : value => $trove_auth_url;
194 196
     }

+ 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
 #
@@ -183,6 +183,12 @@
183 183
 #   (in seconds). Set to -1 to disable caching completely. Integer value
184 184
 #   Defaults to $::os_service_default.
185 185
 #
186
+# DEPRECATED PARAMETERS
187
+#
188
+# [*auth_uri*]
189
+#   (Optional) Complete public Identity API endpoint.
190
+#   Defaults to undef
191
+#
186 192
 class trove::keystone::authtoken(
187 193
   $username                       = 'trove',
188 194
   $password                       = $::os_service_default,
@@ -193,7 +199,7 @@ class trove::keystone::authtoken(
193 199
   $insecure                       = $::os_service_default,
194 200
   $auth_section                   = $::os_service_default,
195 201
   $auth_type                      = 'password',
196
-  $auth_uri                       = 'http://localhost:5000',
202
+  $www_authenticate_uri           = 'http://localhost:5000',
197 203
   $auth_version                   = $::os_service_default,
198 204
   $cache                          = $::os_service_default,
199 205
   $cafile                         = $::os_service_default,
@@ -218,6 +224,8 @@ class trove::keystone::authtoken(
218 224
   $manage_memcache_package        = false,
219 225
   $region_name                    = $::os_service_default,
220 226
   $token_cache_time               = $::os_service_default,
227
+  # DEPRECATED PARAMETERS
228
+  $auth_uri                       = undef,
221 229
 ) {
222 230
 
223 231
   include ::trove::deps
@@ -226,12 +234,17 @@ class trove::keystone::authtoken(
226 234
     fail('Please set password for trove service user')
227 235
   }
228 236
 
237
+  if $auth_uri {
238
+    warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.')
239
+  }
240
+  $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri)
241
+
229 242
   keystone::resource::authtoken { 'trove_config':
230 243
     username                       => $username,
231 244
     password                       => $password,
232 245
     project_name                   => $project_name,
233 246
     auth_url                       => $auth_url,
234
-    auth_uri                       => $auth_uri,
247
+    www_authenticate_uri           => $www_authenticate_uri_real,
235 248
     auth_version                   => $auth_version,
236 249
     auth_type                      => $auth_type,
237 250
     auth_section                   => $auth_section,

+ 4
- 0
releasenotes/notes/deprecate_auth_uri_parameter-87ffc735509a6e7c.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/trove_keystone_authtoken_spec.rb View File

@@ -20,7 +20,7 @@ describe 'trove::keystone::authtoken' do
20 20
         is_expected.to contain_trove_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
21 21
         is_expected.to contain_trove_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
22 22
         is_expected.to contain_trove_config('keystone_authtoken/auth_type').with_value('password')
23
-        is_expected.to contain_trove_config('keystone_authtoken/auth_uri').with_value('http://localhost:5000')
23
+        is_expected.to contain_trove_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000')
24 24
         is_expected.to contain_trove_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
25 25
         is_expected.to contain_trove_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
26 26
         is_expected.to contain_trove_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
@@ -50,7 +50,7 @@ describe 'trove::keystone::authtoken' do
50 50
     context 'when overriding parameters' do
51 51
       before do
52 52
         params.merge!({
53
-          :auth_uri                             => 'https://10.0.0.1:9999/',
53
+          :www_authenticate_uri                 => 'https://10.0.0.1:9999/',
54 54
           :username                             => 'myuser',
55 55
           :password                             => 'mypasswd',
56 56
           :auth_url                             => 'http://:127.0.0.1:35357',
@@ -88,7 +88,7 @@ describe 'trove::keystone::authtoken' do
88 88
       end
89 89
 
90 90
       it 'configure keystone_authtoken' do
91
-        is_expected.to contain_trove_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
91
+        is_expected.to contain_trove_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
92 92
         is_expected.to contain_trove_config('keystone_authtoken/username').with_value(params[:username])
93 93
         is_expected.to contain_trove_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
94 94
         is_expected.to contain_trove_config('keystone_authtoken/auth_url').with_value(params[:auth_url])

Loading…
Cancel
Save