From f7c6d5d3c3337646913507c4dff0155e6d2ed59f Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 22 Jan 2020 20:10:17 -0700 Subject: [PATCH] Only include graph links in osTicket posts --- scripts/wk/graph.py | 2 +- scripts/wk/hw/diags.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/wk/graph.py b/scripts/wk/graph.py index 0443ceb2..8de5c3be 100644 --- a/scripts/wk/graph.py +++ b/scripts/wk/graph.py @@ -48,7 +48,7 @@ THRESH_GREAT = 750 * 1024**2 # Functions def export_io_graph(disk, log_dir, read_rates): - """Exports PNG graph using gnuplot, returns pathlib.Path obj.""" + """Exports PNG graph using gnuplot.""" # Safety check if not read_rates: diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 1e361cad..ee5dbd17 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -585,11 +585,12 @@ def check_io_benchmark_results(test_obj, rate_list, graph_width, state): # osTicket - Export PNG image_path = None + test_obj.upload_report = [] try: image_path = graph.export_io_graph(test_obj.dev, state.log_dir, rate_list) except RuntimeError: - # Failed to export PNG, skip upload steps below - test_obj.report.append('Failed to export graph') + # Failed to export PNG, skip uploads below + test_obj.upload_report.append('Failed to export graph') return # osTicket - Upload PNG @@ -598,10 +599,10 @@ def check_io_benchmark_results(test_obj, rate_list, graph_width, state): imgur_url = graph.upload_to_imgur(image_path) nextcloud_url = graph.upload_to_nextcloud( image_path, state.ost.ticket_id, test_obj.dev.path.name) - test_obj.report.append(f'Imgur: {imgur_url}') - test_obj.report.append(f'Nextcloud: {nextcloud_url}') + test_obj.upload_report.append(f'Imgur: {imgur_url}') + test_obj.upload_report.append(f'Nextcloud: {nextcloud_url}') except RuntimeError: - test_obj.report.append('Failed to upload graph') + test_obj.upload_report.append('Failed to upload graph') def check_mprime_results(test_obj, working_dir): @@ -1301,6 +1302,9 @@ def ost_build_report(dev, dev_type): else: report.extend(ost_convert_report(test.report, start_index=1)) + # I/O graph upload report + report.extend(getattr(test, 'upload_report', [])) + # Spacer report.append('')