Update auth_uri option to www_authenticate_uri

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: Ic9c19c216fa85ac5125b39a6346539b0e8eacbfd
This commit is contained in:
caoyuan 2018-04-19 20:02:22 +08:00
parent f1b20cd4a9
commit 292d0042d6
4 changed files with 12 additions and 11 deletions

View File

@ -46,7 +46,7 @@
[keystone_authtoken]
...
memcached_servers = controller:11211
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default

View File

@ -27,7 +27,7 @@ Configure components
[neutron]
...
url = http://controller:9696
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
@ -40,7 +40,7 @@ Configure components
[nova]
...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
@ -53,7 +53,7 @@ Configure components
[cinder]
...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password

View File

@ -43,7 +43,7 @@
[keystone_authtoken]
...
memcached_servers = controller:11211
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default

View File

@ -71,12 +71,12 @@ class TestOpenStackClient(object):
"""
def __init__(self, auth_user, auth_key, auth_uri):
def __init__(self, auth_user, auth_key, www_authenticate_uri):
super(TestOpenStackClient, self).__init__()
self.auth_result = None
self.auth_user = auth_user
self.auth_key = auth_key
self.auth_uri = auth_uri
self.www_authenticate_uri = www_authenticate_uri
# default project_id
self.project_id = 'openstack'
@ -114,16 +114,17 @@ class TestOpenStackClient(object):
if self.auth_result:
return self.auth_result
auth_uri = self.auth_uri
www_authenticate_uri = self.www_authenticate_uri
headers = {'X-Auth-User': self.auth_user,
'X-Auth-Key': self.auth_key,
'X-Auth-Project-Id': self.project_id}
response = self.request(auth_uri,
response = self.request(www_authenticate_uri,
headers=headers)
http_status = response.status
LOG.debug("%(auth_uri)s => code %(http_status)s.",
{"auth_uri": auth_uri, "http_status": http_status})
LOG.debug("%(www_authenticate_uri)s => code %(http_status)s.",
{"www_authenticate_uri": www_authenticate_uri,
"http_status": http_status})
if http_status == 401:
raise OpenStackApiAuthenticationException(response=response)