tools/fiograph: improve default output file name
authorVincent Fu <vincent.fu@samsung.com>
Wed, 18 Jan 2023 15:52:31 +0000 (10:52 -0500)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 19 Jan 2023 00:52:15 +0000 (19:52 -0500)
Instead of removing all occurrences of '.fio' in the job filename, only
remove '.fio' when it is at the end of the job filename.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
tools/fiograph/fiograph.py

index 8fbd1909e2fe6c94619fed2bf063e75adbc47272..03c2cacd2d05211667c2a95c0cdba13f0d872dc9 100755 (executable)
@@ -294,7 +294,8 @@ def main():
     args = setup_commandline()
     if args.output is None:
         output_file = args.file
-        output_file = output_file.replace('.fio', '')
+        if output_file.endswith('.fio'):
+            output_file = output_file[:-4]
     else:
         output_file = args.output
     config_file = configparser.RawConfigParser(allow_no_value=True)