Commit 3954c628 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

pretty-print command results

Most obvious change is for the command "Stats show", where the blob of stats data is now printed ina more readable fashion.
Also removed the print of 'send the command' line, and empty results are not printed at all
parent 11f1c880
......@@ -622,9 +622,11 @@ class BindCmdInterpreter(Cmd):
if (len(cmd.params) != 0):
cmd_params = json.dumps(cmd.params)
print("send the command to cmd-ctrld")
reply = self.send_POST(url, cmd.params)
data =
print("received reply:", data)
# The reply is a string containing JSON data,
# parse it, then prettyprint
if data != "" and data != "{}":
print(json.dumps(json.loads(data), sort_keys=True, indent=4))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment