[nft PATCH 2/4] tests/py: Fix error messages in chain_delete()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 tests/py/nft-test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 5c7e28a070204..1c0afd0ec0eb3 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
 
-- 
2.21.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux