2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

Fix formation of error message

Use format to take in the parameters regardless of type
This commit is contained in:
Jarrod Johnson 2023-02-27 14:55:01 -05:00
parent 9f7e53701e
commit b4182cd4b5

View File

@ -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))
results.put(msg.SensorReadings(hinfo.get('sensors', []), name=node))