Skip to content

Commit

Permalink
DAOS-16709 test: Handle decoding empty json output (#15397)
Browse files Browse the repository at this point in the history
Do not raise an exception if parsing empty json output.

Signed-off-by: Phil Henderson <[email protected]>
  • Loading branch information
phender authored Oct 28, 2024
1 parent 1d2d48f commit 1a53cc9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tests/ftest/util/command_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,9 @@ def _get_json_result(self, sub_command_list=None, json_err=False,
self.output_check = prev_output_check
if json_err:
self.exit_status_exception = prev_exit_exception
if not self.result.stdout:
# Avoid expected json.decode("") exception when there is nothing to decode
return {}
return json.loads(self.result.stdout)

def _get_new(self):
Expand Down

0 comments on commit 1a53cc9

Please sign in to comment.