Always use Identity v3 API

... because v2 API was removed multiple cycles ago.

Depends-on: https://review.opendev.org/924027
Change-Id: I434b7bd8fd7f23040a69c2ffc05902c4491c2b27
This commit is contained in:
Takashi Kajinami 2024-07-16 19:41:13 +09:00
parent 033dfe61d8
commit 33fba03f84
2 changed files with 9 additions and 20 deletions

View File

@ -501,7 +501,6 @@ function configure_tempest_for_heat {
iniset $TEMPEST_CONFIG heat_plugin user_domain_name $OS_USER_DOMAIN_NAME
iniset $TEMPEST_CONFIG heat_plugin project_domain_name $OS_PROJECT_DOMAIN_NAME
iniset $TEMPEST_CONFIG heat_plugin region $OS_REGION_NAME
iniset $TEMPEST_CONFIG heat_plugin auth_version 3
source $TOP_DIR/openrc admin admin
iniset $TEMPEST_CONFIG heat_plugin admin_username $OS_USERNAME

View File

@ -12,7 +12,6 @@
import os
from heat.common.i18n import _
from heatclient import client as heat_client
from keystoneauth1.identity.generic import password
from keystoneauth1 import session
@ -59,20 +58,14 @@ class ClientManager(object):
calling various OpenStack APIs.
"""
HEATCLIENT_VERSION = '1'
HEAT_API_VERSION = '1'
KEYSTONE_API_VERSION = '3'
NOVA_API_VERSION = '2.1'
def __init__(self, conf, admin_credentials=False):
self.conf = conf
self.admin_credentials = admin_credentials
self.auth_version = self.conf.auth_version
if not self.auth_version:
try:
self.auth_version = self.conf.auth_url.split('/v')[1]
except IndexError:
raise ValueError(_('Please specify version in auth_url or '
'auth_version in config.'))
self.insecure = self.conf.disable_ssl_certificate_validation
self.ca_file = self.conf.ca_file
@ -105,7 +98,7 @@ class ClientManager(object):
session = self.identity_client.session
return heat_client.Client(
self.HEATCLIENT_VERSION,
self.HEAT_API_VERSION,
endpoint,
session=session,
endpoint_type='publicURL',
@ -123,15 +116,12 @@ class ClientManager(object):
'username': self._username(),
'password': self._password(),
'project_name': self._project_name(),
'auth_url': self.conf.auth_url
'auth_url': self.conf.auth_url,
'user_domain_id': user_domain_id,
'project_domain_id': project_domain_id,
'user_domain_name': user_domain_name,
'project_domain_name': project_domain_name
}
# keystone v2 can't ignore domain details
if self.auth_version == '3':
kwargs.update({
'user_domain_id': user_domain_id,
'project_domain_id': project_domain_id,
'user_domain_name': user_domain_name,
'project_domain_name': project_domain_name})
auth = password.Password(**kwargs)
if self.insecure:
verify_cert = False
@ -160,7 +150,7 @@ class ClientManager(object):
def _get_object_client(self):
args = {
'auth_version': self.auth_version,
'auth_version': self.KEYSTONE_API_VERSION,
'session': self.identity_client.session,
'os_options': {'endpoint_type': 'publicURL',
'region_name': self.conf.region,