]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/py: Fix error messages in chain_delete()
authorPhil Sutter <phil@nwl.cc>
Thu, 25 Apr 2019 12:59:41 +0000 (14:59 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Apr 2019 12:20:57 +0000 (14:20 +0200)
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 <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/py/nft-test.py

index 5c7e28a07020449b760859684199f1ab5fa25e4c..1c0afd0ec0eb32f825053c1cc58eea11e67bfe61 100755 (executable)
@@ -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