add support for gnocchi client

Change-Id: I65dd102635b1f6c6500a9c34da130aaea33708b2
This commit is contained in:
Niv Oppenhaim 2018-06-11 12:09:48 +00:00
parent d5c742f460
commit d68438ad90
3 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@ fixtures==3.0.0
flake8==2.5.5
future==0.16.0
futurist==1.6.0
gnocchiclient==3.3.1
greenlet==0.4.13
hacking==0.12.0
idna==2.6

View File

@ -15,6 +15,7 @@ python-novaclient>=10.1.0 # Apache-2.0
python-heatclient>=1.14.0 # Apache-2.0
python-mistralclient>=3.3.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0
gnocchiclient>=3.3.1 # Apache-2.0
pyzabbix>=0.7.4 # LGPL
networkx>=1.11 # BSD
oslo.config>=5.2.0 # Apache-2.0

View File

@ -28,6 +28,7 @@ OPTS = [
cfg.StrOpt('glance_version', default='2', help='Glance version'),
cfg.StrOpt('heat_version', default='1', help='Heat version'),
cfg.StrOpt('mistral_version', default='2', help='Mistral version'),
cfg.StrOpt('gnocchi_version', default='1', help='Gnocchi version')
]
_client_modules = {
@ -39,6 +40,7 @@ _client_modules = {
'neutron': 'neutronclient.v2_0.client',
'heat': 'heatclient.client',
'mistral': 'mistralclient.api.v2.client',
'gnocchi': 'gnocchiclient.v1.client'
}
@ -48,6 +50,18 @@ def driver_module(driver):
return module
def gnocchi_client(conf):
"""Get an instance of the gnocchi client"""
try:
gn_client = driver_module('gnocchi')
client = gn_client.Client(
session=keystone_client.get_session(conf))
LOG.info('Gnocchi client created')
return client
except Exception:
LOG.exception('Create Gnocchi client - Got Exception')
def aodh_client(conf):
"""Get an instance of aodh client"""
try: