From: Phil Sutter Date: Thu, 25 Apr 2019 12:59:41 +0000 (+0200) Subject: tests/py: Fix error messages in chain_delete() X-Git-Tag: v0.9.1~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0130e777ead5e9128b58b7fe8c99e4052cff090;p=thirdparty%2Fnftables.git tests/py: Fix error messages in chain_delete() Adding string and chain object is an illegal operation in Python. Instead concatenate with cmd string since that contains all required information already. Fixes: 820fd08b5f1d4 ("tests/py: Review print statements in nft-test.py") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 5c7e28a0..1c0afd0e 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -310,14 +310,14 @@ def chain_delete(chain, table, filename=None, lineno=None): cmd = "flush chain %s %s" % (table, chain) ret = execute_cmd(cmd, filename, lineno) if ret != 0: - reason = "I cannot flush this chain " + chain + reason = "I cannot " + cmd print_error(reason, filename, lineno) return -1 cmd = "delete chain %s %s" % (table, chain) ret = execute_cmd(cmd, filename, lineno) if ret != 0: - reason = cmd + "I cannot delete this chain " + chain + reason = "I cannot " + cmd print_error(reason, filename, lineno) return -1