]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests: json_echo: Print errors to stderr
authorPhil Sutter <phil@nwl.cc>
Wed, 11 Aug 2021 16:14:06 +0000 (18:14 +0200)
committerPhil Sutter <phil@nwl.cc>
Tue, 24 Aug 2021 16:44:15 +0000 (18:44 +0200)
commitf74f277a3a965261d16f60b0331bad6c22af10a9
tree3c9e419b1a4014c8fc490fecee9808e7f44d1c95
parentbd6ba14bebd27181ee18cfc3aebb21a78d96d672
tests: json_echo: Print errors to stderr

Apart from the obvious, this fixes exit_dump() which tried to dump the
wrong variable ('out' instead of 'obj') and missed that json.dumps()
doesn't print but just returns a string. Make it call exit_err() to
share some code, which changes the prefix from 'FAIL' to 'Error' as a
side-effect.

While being at it, fix for a syntax warning with newer Python in
unrelated code.

Fixes: bb32d8db9a125 ("JSON: Add support for echo option")
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/json_echo/run-test.py