Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stall-analyser: avoid referencing undefined variable
before this change, if user specifies an emtpy file to `--file`, the body of `for s in args.file` loop is not executed, and the script just goes ahead and tries to print out the analyse result, it's fine, as the result is empty. but we pass a yet-defined variable to `print_stats()`, this result in ``` Traceback (most recent call last): File "/home/bhalevy/dev/scylla_s3_reloc_server/./seastar//scripts/stall-analyser.py", line 363, in <module> print_stats(tally, tmin) ^^^^ NameError: name 'tmin' is not defined. Did you mean: 'min'? ``` so, in this change, we - use a better name for the `--minimum` option, `args.minimum` is way too general. - use the default value of 0 instead of `None`, simpler this way - just reference `arg.tmin`, so we don't reference an undefined variable even if the stall report file is empty. Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information