Fix keystoneauth adapter for Queens
In Queens api version should be explicitly passed as argument
to get_session_client, in other case it will fail.
Change-Id: Ifffd727074b77d38c829c2d2e8e1af3cf41fe536
Related-Prod: https://mirantis.jira.com/browse/PROD-21285
diff --git a/_modules/gnocchiv1/common.py b/_modules/gnocchiv1/common.py
index 7364c2c..b4ef270 100644
--- a/_modules/gnocchiv1/common.py
+++ b/_modules/gnocchiv1/common.py
@@ -46,8 +46,14 @@
service_type = 'metric'
config = os_client_config.OpenStackConfig()
cloud = config.get_one_cloud(cloud_name)
- adapter = cloud.get_session_client(service_type)
- adapter.version = '1'
+ api_version = '1'
+ try:
+ # NOTE(pas-ha) for Queens and later,
+ # 'version' kwarg in absent for Pike and older
+ adapter = cloud.get_session_client(service_type, version=api_version)
+ except TypeError:
+ adapter = cloud.get_session_client(service_type)
+ adapter.version = api_version
try:
access_info = adapter.session.auth.get_access(adapter.session)
endpoints = access_info.service_catalog.get_endpoints()