From 6a4a9af53817300013951707213662569c641119 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Wed, 2 Oct 2019 11:54:25 +0300 Subject: [PATCH] Fix issues on stable/rocky This patch fixes issues present to stable/rocky branch. Due to heavy refactoring in later branches backporting is no possible. Change-Id: I896a7c49eea1b267099fc90d837458ec7bb7853d Signed-off-by: Stamatis Katsaounis --- doc/source/configuration/configuring.rst | 4 ---- watcher/common/service.py | 6 ++---- watcher/datasource/gnocchi.py | 2 +- watcher/datasource/manager.py | 7 ++++++- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/source/configuration/configuring.rst b/doc/source/configuration/configuring.rst index b77379776..c19130543 100644 --- a/doc/source/configuration/configuring.rst +++ b/doc/source/configuration/configuring.rst @@ -239,10 +239,6 @@ so that the watcher service is configured for your needs. [DEFAULT] - # The messaging driver to use, defaults to rabbit. Other drivers - # include qpid and zmq. (string value) - #rpc_backend = rabbit - # The default exchange under which topics are scoped. May be # overridden by an exchange name specified in the transport_url # option. (string value) diff --git a/watcher/common/service.py b/watcher/common/service.py index c184c8ec0..88c6b2128 100644 --- a/watcher/common/service.py +++ b/watcher/common/service.py @@ -265,8 +265,7 @@ class Service(service.ServiceBase): allow_requeue=False, pool=CONF.host) def start(self): - LOG.debug("Connecting to '%s' (%s)", - CONF.transport_url, CONF.rpc_backend) + LOG.debug("Connecting to '%s'", CONF.transport_url) if self.conductor_topic_handler: self.conductor_topic_handler.start() if self.notification_handler: @@ -275,8 +274,7 @@ class Service(service.ServiceBase): self.heartbeat.start() def stop(self): - LOG.debug("Disconnecting from '%s' (%s)", - CONF.transport_url, CONF.rpc_backend) + LOG.debug("Disconnecting from '%s' (%s)'", CONF.transport_url) if self.conductor_topic_handler: self.conductor_topic_handler.stop() if self.notification_handler: diff --git a/watcher/datasource/gnocchi.py b/watcher/datasource/gnocchi.py index 972d9475f..fd4658f86 100644 --- a/watcher/datasource/gnocchi.py +++ b/watcher/datasource/gnocchi.py @@ -69,7 +69,7 @@ class GnocchiHelper(base.DataSourceBase): def statistic_aggregation(self, resource_id=None, meter_name=None, period=300, granularity=300, dimensions=None, - aggregation='avg', group_by='*'): + aggregation='mean', group_by='*'): """Representing a statistic aggregate by operators :param resource_id: id of resource to list statistics for. diff --git a/watcher/datasource/manager.py b/watcher/datasource/manager.py index b38beb474..b4936ea67 100644 --- a/watcher/datasource/manager.py +++ b/watcher/datasource/manager.py @@ -29,7 +29,12 @@ class DataSourceManager(object): self._monasca = None self._gnocchi = None self.metric_map = base.DataSourceBase.METRIC_MAP - self.datasources = self.config.datasources + if hasattr(self.config, 'datasources'): + self.datasources = self.config.datasources + elif hasattr(self.config, 'datasource'): + self.datasources = [self.config.datasource] + else: + self.datasources = [] @property def ceilometer(self):