Add Watcher client support

Add get_watcher_session_client() helper function to build a
watcherclient.v1.Client instance authenticated with a keystone session
that uses admin credentials by default.
This commit is contained in:
Felipe Reyes
2023-08-23 17:18:33 -04:00
parent e0498d6a16
commit fd824768b5
3 changed files with 12 additions and 0 deletions
+1
View File
@@ -49,6 +49,7 @@ python-neutronclient
python-novaclient
python-octaviaclient
python-swiftclient
python-watcherclient
tenacity
paramiko
+1
View File
@@ -65,6 +65,7 @@ install_require = [
'python-ceilometerclient',
'python-cinderclient<6.0.0',
'python-swiftclient<3.9.0',
'python-watcherclient',
# 'zaza@git+https://github.com/openstack-charmers/zaza.git#egg=zaza',
'zaza',
]
+10
View File
@@ -65,6 +65,7 @@ from keystoneauth1.identity import (
v3,
v2,
)
from watcherclient import client as watcher_client
import zaza.openstack.utilities.cert as cert
import zaza.utilities.deployment_env as deployment_env
import zaza.utilities.juju as juju_utils
@@ -516,6 +517,15 @@ def get_manila_session_client(session, version='2'):
return manilaclient.Client(session=session, client_version=version)
def get_watcher_session_client(session):
"""Return Watcher client authenticated by keystone session.
:param session: Keystone session object
:returns: Authenticated watcher client
"""
return watcher_client.get_client(session=session, api_version='1')
def get_keystone_scope(model_name=None):
"""Return Keystone scope based on OpenStack release of the overcloud.