ha/stolon: Don't attempt to parse unsuccessful Consul responses
@@ -183,6 +183,7 @@ class ConsulProtocol(asyncio.Protocol):
def on_message_complete(self):
try:
+ if self._parser.get_status_code() == 200:
payload = json.loads(b"".join(self._buffers))[0]
last_modify_index = payload["ModifyIndex"]
cluster_data = json.loads(base64.b64decode(payload["Value"]))
