From b4182cd4b55867e9846a902d5988339ae81ab197 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 27 Feb 2023 14:55:01 -0500 Subject: [PATCH] Fix formation of error message Use format to take in the parameters regardless of type --- .../confluent/plugins/hardwaremanagement/affluent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/affluent.py b/confluent_server/confluent/plugins/hardwaremanagement/affluent.py index 71cecea9..ea169b3b 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/affluent.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/affluent.py @@ -49,7 +49,8 @@ class WebClient(object): results.put(msg.ConfluentTargetInvalidCredentials(self.node, 'Unable to authenticate')) return {} elif status != 200: - results.put(msg.ConfluentNodeError(self.node, 'Unknown error: ' + rsp + ' while retrieving ' + url)) + #must be str not bytes + results.put(msg.ConfluentNodeError(self.node, 'Unknown error: {} while retrieving {}'.format(rsp, url))) return {} return rsp @@ -192,4 +193,4 @@ def retrieve_health(configmanager, creds, node, results, element): hinfo = wc.fetch('/affluent/health', results) if hinfo: results.put(msg.HealthSummary(hinfo.get('health', 'unknown'), name=node)) - results.put(msg.SensorReadings(hinfo.get('sensors', []), name=node)) \ No newline at end of file + results.put(msg.SensorReadings(hinfo.get('sensors', []), name=node))