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():