Skip to content

Commit ae2cfd5

Browse files
author
dufuhang
committed
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 <[email protected]>
1 parent c082797 commit ae2cfd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tuned-adm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def check_positive(value):
3434
except ValueError:
3535
val = -1
3636
if val <= 0:
37-
raise argparse.ArgumentTypeError("%s has to be >= 0" % value)
37+
raise argparse.ArgumentTypeError("%s has to be > 0" % value)
3838
return val
3939

4040
def check_log_level(value):

0 commit comments

Comments
 (0)