From 44caf759d09eea7a55f4f1aeccea8e257b357e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Wed, 12 Oct 2022 17:15:52 -0300 Subject: Fix the handle of plain text outputs The handler of Plaintext output was using the wrong data structure to store the output in plaintext. The output needs to be enclosed as a dictionary in a list. Change-Id: Ib134a5a0de135eb1e00073c4dfc6654ad2d93709 --- ceilometer/polling/dynamic_pollster.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ceilometer') diff --git a/ceilometer/polling/dynamic_pollster.py b/ceilometer/polling/dynamic_pollster.py index 0030c607..07edc5ee 100644 --- a/ceilometer/polling/dynamic_pollster.py +++ b/ceilometer/polling/dynamic_pollster.py @@ -66,11 +66,11 @@ class JsonResponseHandler(object): class PlainTextResponseHandler(object): - """This response handler converts a string to a dict {'out'=}""" + """Response handler converts string to a list of dict [{'out'=}]""" @staticmethod def handle(response): - return {'out': str(response)} + return [{'out': str(response)}] VALID_HANDLERS = { @@ -218,6 +218,8 @@ class PollsterSampleExtractor(object): extra_metadata = self.definitions.retrieve_extra_metadata( kwargs['manager'], pollster_sample, kwargs['conf']) + LOG.debug("Extra metadata [%s] collected for sample [%s].", + extra_metadata, pollster_sample) for key in extra_metadata.keys(): if key in metadata.keys(): LOG.warning("The extra metadata key [%s] already exist in " -- cgit v1.2.1