From ae2cfd52e8deb0e78a94457e98511e26191c847a Mon Sep 17 00:00:00 2001 From: dufuhang Date: Wed, 4 Sep 2024 16:23:39 +0800 Subject: [PATCH] Fix the error in the raise statement of check_positive() 1. In the raise statement of the check_positive() function, the error message conflicts with the if condition. 2. If the value of val is 0, it passes the if condition but raises an error message stating [0 has to be >= 0]. 3. This PR removes the = from the raise statement, so when val is 0, it will correctly prompt that the value of val [has to be > 0]. Signed-off-by: dufuhang --- tuned-adm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuned-adm.py b/tuned-adm.py index 632560c..de0c39e 100755 --- a/tuned-adm.py +++ b/tuned-adm.py @@ -34,7 +34,7 @@ def check_positive(value): except ValueError: val = -1 if val <= 0: - raise argparse.ArgumentTypeError("%s has to be >= 0" % value) + raise argparse.ArgumentTypeError("%s has to be > 0" % value) return val def check_log_level(value):