mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
rpc: fix crash in verbose mode
Fix a crash caused by feeding incorrect data to `json.dumps()` in
`JSONServerProxy.__request()` introduced by commit
8159c2883b
.
https://pagure.io/freeipa/issue/6734
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
2fc9feddd0
commit
8295848bfe
@ -1136,16 +1136,17 @@ class JSONServerProxy(object):
|
||||
verbose=self.__verbose >= 3,
|
||||
)
|
||||
|
||||
if print_json:
|
||||
root_logger.info(
|
||||
'Response: %s',
|
||||
json.dumps(json.loads(response), sort_keys=True, indent=4)
|
||||
)
|
||||
|
||||
try:
|
||||
response = json_decode_binary(response)
|
||||
except ValueError as e:
|
||||
raise JSONError(error=str(e))
|
||||
|
||||
if print_json:
|
||||
root_logger.info(
|
||||
'Response: %s',
|
||||
json.dumps(response, sort_keys=True, indent=4)
|
||||
)
|
||||
error = response.get('error')
|
||||
if error:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user