Merge "Deprecate auth_version option"
diff --git a/heat_tempest_plugin/config.py b/heat_tempest_plugin/config.py
index 8876c58..877574f 100644
--- a/heat_tempest_plugin/config.py
+++ b/heat_tempest_plugin/config.py
@@ -59,6 +59,9 @@
cfg.StrOpt('auth_url',
help="Full URI of the OpenStack Identity API (Keystone)."),
cfg.StrOpt('auth_version',
+ deprecated_for_removal=True,
+ deprecated_reason='Identity v2 API was removed and v3 is '
+ 'the only available identity API version now',
help="OpenStack Identity API version."),
cfg.StrOpt('user_domain_name',
help="User domain name, if keystone v3 auth_url "
diff --git a/heat_tempest_plugin/services/clients.py b/heat_tempest_plugin/services/clients.py
index ae4cbe2..ac3235d 100644
--- a/heat_tempest_plugin/services/clients.py
+++ b/heat_tempest_plugin/services/clients.py
@@ -62,18 +62,16 @@
calling various OpenStack APIs.
"""
- CINDERCLIENT_VERSION = '3'
- HEATCLIENT_VERSION = '1'
+ CINDER_API_VERSION = '3'
+ GNOCCHI_API_VERSION = '1'
+ HEAT_API_VERSION = '1'
+ KEYSTONE_API_VERSION = '3'
NOVA_API_VERSION = '2.1'
- GNOCCHI_VERSION = '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:
- self.auth_version = self.conf.auth_url.split('/v')[1]
self.insecure = self.conf.disable_ssl_certificate_validation
self.ca_file = self.conf.ca_file
@@ -108,7 +106,7 @@
session = self.identity_client.session
return heat_client.Client(
- self.HEATCLIENT_VERSION,
+ self.HEAT_API_VERSION,
endpoint,
session=session,
endpoint_type=self.conf.endpoint_type,
@@ -126,15 +124,12 @@
'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,
+ 'user_domain_name': user_domain_name,
+ 'project_domain_id': project_domain_id,
+ '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
@@ -164,7 +159,7 @@
def _get_volume_client(self):
return cinder_client.Client(
- self.CINDERCLIENT_VERSION,
+ self.CINDER_API_VERSION,
session=self.identity_client.session,
endpoint_type=self.conf.endpoint_type,
region_name=self.conf.region,
@@ -172,7 +167,7 @@
def _get_object_client(self):
args = {
- 'auth_version': self.auth_version,
+ 'auth_version': self.KEYSTONE_API_VERSION,
'session': self.identity_client.session,
'cacert': self.ca_file,
'insecure': self.insecure,
@@ -190,5 +185,5 @@
'session': self.identity_client.session,
'adapter_options': adapter_options
}
- return gnocchi_client.Client(version=self.GNOCCHI_VERSION,
+ return gnocchi_client.Client(version=self.GNOCCHI_API_VERSION,
**args)
diff --git a/releasenotes/notes/deprecate-auth_version-45a3cbb9711ac0aa.yaml b/releasenotes/notes/deprecate-auth_version-45a3cbb9711ac0aa.yaml
new file mode 100644
index 0000000..206edad
--- /dev/null
+++ b/releasenotes/notes/deprecate-auth_version-45a3cbb9711ac0aa.yaml
@@ -0,0 +1,5 @@
+---
+deprecations:
+ - |
+ The ``auth_version`` option has been deprecated and has no effect. This
+ option will be removed in a future release.