From 152fbec8f17851ac2917e57516a76eacb2f2e631 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 9 Jul 2018 17:27:09 +0200 Subject: [PATCH] pipeline: simplfy classes Change-Id: I40a54a3cf94f8171db17f2b9ae2def4d0e9d1ab1 --- ceilometer/pipeline/base.py | 18 +++++++----------- ceilometer/pipeline/event.py | 2 +- ceilometer/pipeline/sample.py | 2 +- doc/source/contributor/plugins.rst | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ceilometer/pipeline/base.py b/ceilometer/pipeline/base.py index c109c92d47..d121e50c63 100644 --- a/ceilometer/pipeline/base.py +++ b/ceilometer/pipeline/base.py @@ -335,14 +335,10 @@ class NotificationEndpoint(object): # for the generic notification exchange we have to consume all its # queues - -class MainNotificationEndpoint(NotificationEndpoint): - """Listens to queues on all priority levels and clears by default.""" - - audit = NotificationEndpoint._consume_and_drop - critical = NotificationEndpoint._consume_and_drop - debug = NotificationEndpoint._consume_and_drop - error = NotificationEndpoint._consume_and_drop - info = NotificationEndpoint._consume_and_drop - sample = NotificationEndpoint._consume_and_drop - warn = NotificationEndpoint._consume_and_drop + audit = _consume_and_drop + critical = _consume_and_drop + debug = _consume_and_drop + error = _consume_and_drop + info = _consume_and_drop + sample = _consume_and_drop + warn = _consume_and_drop diff --git a/ceilometer/pipeline/event.py b/ceilometer/pipeline/event.py index 996c9bf301..5cbba7371b 100644 --- a/ceilometer/pipeline/event.py +++ b/ceilometer/pipeline/event.py @@ -22,7 +22,7 @@ from ceilometer.pipeline import base LOG = log.getLogger(__name__) -class EventEndpoint(base.MainNotificationEndpoint): +class EventEndpoint(base.NotificationEndpoint): event_types = [] diff --git a/ceilometer/pipeline/sample.py b/ceilometer/pipeline/sample.py index 429a8fedb8..79999d0bbf 100644 --- a/ceilometer/pipeline/sample.py +++ b/ceilometer/pipeline/sample.py @@ -19,7 +19,7 @@ from ceilometer.pipeline import base LOG = log.getLogger(__name__) -class SampleEndpoint(base.MainNotificationEndpoint): +class SampleEndpoint(base.NotificationEndpoint): def info(self, notifications): """Convert message at info level to Ceilometer sample. diff --git a/doc/source/contributor/plugins.rst b/doc/source/contributor/plugins.rst index 9b19807728..9262f37c89 100644 --- a/doc/source/contributor/plugins.rst +++ b/doc/source/contributor/plugins.rst @@ -92,7 +92,7 @@ pipelines based on a given configuration file. Pipelines are required to define `Source` and `Sink` permutations to describe how to process notification. Additionally, it must set ``get_main_endpoints`` which provides endpoints to be added to the main queue listener in the notification agent. This main queue -endpoint inherits :class:`ceilometer.pipeline.base.MainNotificationEndpoint` +endpoint inherits :class:`ceilometer.pipeline.base.NotificationEndpoint` and defines which notification priorities to listen, normalises the data, and redirects the data for pipeline processing.