louwrentius / fio-plot

Create charts from FIO storage benchmark tool output
BSD 3-Clause "New" or "Revised" License
370 stars 87 forks source link

bench-fio fails when type=rbd because of TypeError #134

Closed ossarchitect closed 9 months ago

ossarchitect commented 9 months ago

This issue concerns the bench-fio tool. The issue appears when using Ceph rbd as device type: The -d parameter is required and I feed it a string (the name of the image I want to use). In line 31 of filter_options of bench_fio/benchlib/generatefio.py the parameter from filetype is checked against the type list and as it is rbd the check_target_type function returns None. This result (None) is then assigned to the variable devicetype (still line 31, bench_fio/benchlib/generatefio.py), which in line 32 is used as an index for a dictionary, which fails, as expected The result is a stacktrace with a TypeError (should be string, is None)

As the checks.check_target_type function is used only once and thus no side effects are expected, it should return 'rbdname' instead of None. That way the devicetype variable would be set correctly and the field rbdname in the config dictionary would be set correctly, so fio can go to work.

ossarchitect commented 9 months ago

Fixed in the code and merged.