From d5b512b6fa6a7571ea3a82c9d5129045c4aa9f78 Mon Sep 17 00:00:00 2001 From: Pierre Cheynier Date: Fri, 5 Feb 2021 15:37:44 +0100 Subject: [PATCH] connect: fix wrong endpoints callbacks In be07afd ("Introduce Consul Connect-related API wrappers") multiple endpoint callbacks were associated to the wrong callback type, resulting in boolean results where json payload is expected. --- consul/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/consul/base.py b/consul/base.py index fb35944..c9a03b9 100755 --- a/consul/base.py +++ b/consul/base.py @@ -1169,7 +1169,7 @@ def authorize( params.append(('token', token)) return self.agent.http.put( - CB.bool(), + CB.json(), '/v1/agent/connect/authorize', params=params, data=json.dumps(payload)) @@ -1190,7 +1190,7 @@ def leaf(self, service, token=None): params.append(('token', token)) return self.agent.http.get( - CB.bool(), + CB.json(), '/v1/agent/connect/ca/leaf/%s' % service, params=params) @@ -2617,7 +2617,7 @@ def roots(self, pem=False, token=None): params.append(('token', token)) return self.agent.http.get( - CB.bool(), + CB.json(), '/v1/connect/ca/roots', params=params) @@ -2628,6 +2628,6 @@ def configuration(self, token=None): params.append(('token', token)) return self.agent.http.get( - CB.bool(), + CB.json(), '/v1/connect/ca/configuration', params=params)