diff options
author | Máté Eckl <ecklm94@gmail.com> | 2018-05-17 09:37:02 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-05-17 15:36:19 +0200 |
commit | bd92c25ac3e1c173f085f4bf502bed372d281e7a (patch) | |
tree | de6f7195b1c4f01dd9486037e66c0e723ba110d1 /tests/py/nft-test.py | |
parent | 75d0c49eb71518b41b86019a2dc9d5a251c060e6 (diff) |
tests: py: Make diff functions use print_* functions
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/nft-test.py')
-rwxr-xr-x | tests/py/nft-test.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index b536e9cd..edc0b4b1 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -161,15 +161,13 @@ def color_differences(rule, other, color): def print_differences_warning(filename, lineno, rule1, rule2, cmd): colored_rule1 = color_differences(rule1, rule2, Colors.YELLOW) colored_rule2 = color_differences(rule2, rule1, Colors.YELLOW) - reason = "'" + colored_rule1 + "' mismatches '" + colored_rule2 + "'" - print filename + ": " + Colors.YELLOW + "WARNING: " + Colors.ENDC + \ - "line: " + str(lineno + 1) + ": '" + cmd + "': " + reason + reason = "'%s': '%s' mismatches '%s'" % (cmd, colored_rule1, colored_rule2) + print_warning(reason, filename, lineno) def print_differences_error(filename, lineno, cmd): - reason = "Listing is broken." - print filename + ": " + Colors.RED + "ERROR: " + Colors.ENDC + "line: " + \ - str(lineno + 1) + ": '" + cmd + "': " + reason + reason = "'%s': Listing is broken." % cmd + print_error(reason, filename, lineno) def table_exist(table, filename, lineno): |