Browse Source

Deprecate auth_uri parameter

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

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

@@ -75,7 +75,7 @@ class Puppet::Provider::Neutron < Puppet::Provider::Openstack
75 75
 
76 76
   def self.get_neutron_credentials
77 77
     #needed keys for authentication
78
-    auth_keys = ['auth_uri', 'project_name', 'username', 'password']
78
+    auth_keys = ['www_authenticate_uri', 'project_name', 'username', 'password']
79 79
     conf = neutron_conf
80 80
     if conf and conf['keystone_authtoken'] and
81 81
         auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?}
@@ -104,7 +104,7 @@ class Puppet::Provider::Neutron < Puppet::Provider::Openstack
104 104
 
105 105
   def self.get_auth_endpoint
106 106
     q = neutron_credentials
107
-    "#{q['auth_uri']}"
107
+    "#{q['www_authenticate_uri']}"
108 108
   end
109 109
 
110 110
   def self.auth_endpoint

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

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

+ 4
- 0
releasenotes/notes/deprecate_auth_uri_parameter-81afb74d42ee6f83.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/neutron_keystone_authtoken_spec.rb View File

@@ -20,7 +20,7 @@ describe 'neutron::keystone::authtoken' do
20 20
         is_expected.to contain_neutron_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
21 21
         is_expected.to contain_neutron_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
22 22
         is_expected.to contain_neutron_config('keystone_authtoken/auth_type').with_value('password')
23
-        is_expected.to contain_neutron_config('keystone_authtoken/auth_uri').with_value('http://localhost:5000')
23
+        is_expected.to contain_neutron_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000')
24 24
         is_expected.to contain_neutron_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
25 25
         is_expected.to contain_neutron_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
26 26
         is_expected.to contain_neutron_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
@@ -50,7 +50,7 @@ describe 'neutron::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                             => 'https://127.0.0.1:35357',
@@ -88,7 +88,7 @@ describe 'neutron::keystone::authtoken' do
88 88
       end
89 89
 
90 90
       it 'configure keystone_authtoken' do
91
-        is_expected.to contain_neutron_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
91
+        is_expected.to contain_neutron_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
92 92
         is_expected.to contain_neutron_config('keystone_authtoken/username').with_value(params[:username])
93 93
         is_expected.to contain_neutron_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
94 94
         is_expected.to contain_neutron_config('keystone_authtoken/auth_url').with_value(params[:auth_url])

+ 8
- 8
spec/unit/provider/neutron_spec.rb View File

@@ -11,12 +11,12 @@ describe Puppet::Provider::Neutron do
11 11
 
12 12
   let :credential_hash do
13 13
     {
14
-      'project_name'        => 'admin_tenant',
15
-      'username'            => 'admin',
16
-      'password'            => 'password',
17
-      'auth_uri'            => 'https://192.168.56.210:35357/v2.0/',
18
-      'project_domain_name' => 'Default',
19
-      'user_domain_name'    => 'Default',
14
+      'project_name'         => 'admin_tenant',
15
+      'username'             => 'admin',
16
+      'password'             => 'password',
17
+      'www_authenticate_uri' => 'https://192.168.56.210:35357/v2.0/',
18
+      'project_domain_name'  => 'Default',
19
+      'user_domain_name'     => 'Default',
20 20
     }
21 21
   end
22 22
 
@@ -65,7 +65,7 @@ describe Puppet::Provider::Neutron do
65 65
 
66 66
     it 'should set auth credentials in the environment' do
67 67
       authenv = {
68
-        :OS_AUTH_URL            => credential_hash['auth_uri'],
68
+        :OS_AUTH_URL            => credential_hash['www_authenticate_uri'],
69 69
         :OS_USERNAME            => credential_hash['username'],
70 70
         :OS_PROJECT_NAME        => credential_hash['project_name'],
71 71
         :OS_PASSWORD            => credential_hash['password'],
@@ -79,7 +79,7 @@ describe Puppet::Provider::Neutron do
79 79
 
80 80
     it 'should set region in the environment if needed' do
81 81
       authenv = {
82
-        :OS_AUTH_URL            => credential_hash['auth_uri'],
82
+        :OS_AUTH_URL            => credential_hash['www_authenticate_uri'],
83 83
         :OS_USERNAME            => credential_hash['username'],
84 84
         :OS_PROJECT_NAME        => credential_hash['project_name'],
85 85
         :OS_PASSWORD            => credential_hash['password'],

Loading…
Cancel
Save