From c52082a344508d815ccf98944b82663224de3e29 Mon Sep 17 00:00:00 2001 From: davidzhubo Date: Fri, 15 Jun 2018 11:32:09 +0800 Subject: [PATCH] Add multi-region support for gnocchi collector Change-Id: I27973ec41baccd024677649f405c95506a5f3261 --- cloudkitty/collector/gnocchi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cloudkitty/collector/gnocchi.py b/cloudkitty/collector/gnocchi.py index ae760a31..8d08cd95 100644 --- a/cloudkitty/collector/gnocchi.py +++ b/cloudkitty/collector/gnocchi.py @@ -55,6 +55,10 @@ gcollector_opts = [ default='internalURL', help='Endpoint URL type (for keystone auth only)', ), + cfg.StrOpt( + 'region_name', + default='RegionOne', + help='Region Name'), ] cfg.CONF.register_opts(gnocchi_collector_opts, GNOCCHI_COLLECTOR_OPTS) @@ -67,7 +71,6 @@ ks_loading.register_auth_conf_options( GNOCCHI_COLLECTOR_OPTS) CONF = cfg.CONF - GNOCCHI_EXTRA_SCHEMA = { Required('extra_args'): { Required('resource_type'): All(str, Length(min=1)), @@ -106,6 +109,7 @@ class GnocchiCollector(collector.BaseCollector): user=CONF.gnocchi_collector.gnocchi_user, endpoint=CONF.gnocchi_collector.gnocchi_endpoint, ) + adapter_options['region_name'] = CONF.gnocchi_collector.region_name self._conn = gclient.Client( '1', session_options={'auth': auth_plugin},