Add support for www_authentication_uri

We do currently not support www_authentication_uri at all, which
is the new standard, as auth_uri has long been deprecated.

* Make sure we support both auth_uri and www_authenticate_uri.
* Switched to www_authenticate_uri for devstack.
* Fixed a bug where a bad exception would be thrown if auth_uri
  was not set.
  
Story: 2004271
Task: 27819

Change-Id: Ibc932d35f3d6ba2ac7ffb6193aa37bd4a3d4422e
(cherry picked from commit 718cb9c9b4)
This commit is contained in:
Erik Olof Gunnar Andersson 2018-10-29 23:47:17 -07:00 committed by Manuel Rodriguez
parent 051dce3491
commit e10c02fb3d
3 changed files with 8 additions and 3 deletions

View File

@ -161,7 +161,7 @@ function create_magnum_conf {
configure_auth_token_middleware $MAGNUM_CONF magnum $MAGNUM_AUTH_CACHE_DIR
iniset $MAGNUM_CONF keystone_auth auth_url $KEYSTONE_AUTH_URI_V3
iniset $MAGNUM_CONF keystone_authtoken auth_uri $KEYSTONE_SERVICE_URI_V3
iniset $MAGNUM_CONF keystone_authtoken www_authenticate_uri $KEYSTONE_SERVICE_URI_V3
iniset $MAGNUM_CONF keystone_authtoken auth_url $KEYSTONE_AUTH_URI_V3
iniset $MAGNUM_CONF keystone_authtoken auth_version v3

View File

@ -44,7 +44,12 @@ class KeystoneClientV3(object):
def auth_url(self):
# FIXME(pauloewerton): auth_url should be retrieved from keystone_auth
# section by default
return CONF[ksconf.CFG_LEGACY_GROUP].auth_uri.replace('v2.0', 'v3')
conf = CONF[ksconf.CFG_LEGACY_GROUP]
auth_uri = (getattr(conf, 'www_authenticate_uri', None) or
getattr(conf, 'auth_uri', None))
if auth_uri:
auth_uri = auth_uri.replace('v2.0', 'v3')
return auth_uri
@property
def auth_token(self):

View File

@ -67,7 +67,7 @@ function create_test_data {
local magnum_api_ip=$(iniget /etc/magnum/magnum.conf api host)
local magnum_api_port=$(iniget /etc/magnum/magnum.conf api port)
local magnum_url="http://"$magnum_api_ip":"$magnum_api_port"/v1"
local keystone_auth_url=$(iniget /etc/magnum/magnum.conf keystone_authtoken auth_uri)
local keystone_auth_url=$(iniget /etc/magnum/magnum.conf keystone_authtoken www_authenticate_uri)
# pass the appropriate variables via a config file
CREDS_FILE=$MAGNUM_DIR/functional_creds.conf