From 9e4f41af94a4850e00abd03d5bee6fc422b3d50a Mon Sep 17 00:00:00 2001 From: Jake Freck Date: Tue, 7 Aug 2018 15:03:58 -0700 Subject: [PATCH] fix diagnostic tool return value --- aztk/spark/client/cluster/helpers/diagnostics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aztk/spark/client/cluster/helpers/diagnostics.py b/aztk/spark/client/cluster/helpers/diagnostics.py index fbd6ef70..e99f432f 100644 --- a/aztk/spark/client/cluster/helpers/diagnostics.py +++ b/aztk/spark/client/cluster/helpers/diagnostics.py @@ -13,17 +13,18 @@ def _run(spark_cluster_operations, cluster_id, output_directory=None): ssh_cmd = _build_diagnostic_ssh_command() run_output = spark_cluster_operations.run(cluster_id, ssh_cmd, host=True) remote_path = "/tmp/debug.zip" + result = None if output_directory: local_path = os.path.join(os.path.abspath(output_directory), "debug.zip") - output = spark_cluster_operations.download(cluster_id, remote_path, local_path, host=True) + result = spark_cluster_operations.download(cluster_id, remote_path, local_path, host=True) # write run output to debug/ directory with open(os.path.join(os.path.dirname(local_path), "debug-output.txt"), 'w', encoding="UTF-8") as f: [f.write(line + '\n') for node_output in run_output for line in node_output.output] else: - output = spark_cluster_operations.download(cluster_id, remote_path, host=True) + result = spark_cluster_operations.download(cluster_id, remote_path, host=True) - return output + return result def _build_diagnostic_ssh_command():