From 1a06153655be4fe97f99fa5d07277b248c2c90e2 Mon Sep 17 00:00:00 2001 From: Salamandar <6552989+Salamandar@users.noreply.github.com> Date: Sat, 24 Feb 2024 12:09:38 +0100 Subject: [PATCH] Fix nginx test grep will return 0 when it finds matches. In our case, when it finds matches, we need to print the warning. --- package_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index 9e3d439..504581e 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1447,7 +1447,7 @@ class Configurations(TestSuite): cmd = 'grep -q -IhEro "location ~ __PATH__" %s' % (app.path + "/conf/" + filename) - if os.system(cmd) != 0: + if os.system(cmd) == 0: yield Info( "When using regexp in the nginx location field (location ~ __PATH__), start the path with ^ (location ~ ^__PATH__)." )