зеркало из https://github.com/Azure/aztk.git
fix diagnostic tool return value
This commit is contained in:
Родитель
a3a220e44d
Коммит
9e4f41af94
|
@ -13,17 +13,18 @@ def _run(spark_cluster_operations, cluster_id, output_directory=None):
|
||||||
ssh_cmd = _build_diagnostic_ssh_command()
|
ssh_cmd = _build_diagnostic_ssh_command()
|
||||||
run_output = spark_cluster_operations.run(cluster_id, ssh_cmd, host=True)
|
run_output = spark_cluster_operations.run(cluster_id, ssh_cmd, host=True)
|
||||||
remote_path = "/tmp/debug.zip"
|
remote_path = "/tmp/debug.zip"
|
||||||
|
result = None
|
||||||
if output_directory:
|
if output_directory:
|
||||||
local_path = os.path.join(os.path.abspath(output_directory), "debug.zip")
|
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
|
# 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:
|
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]
|
[f.write(line + '\n') for node_output in run_output for line in node_output.output]
|
||||||
else:
|
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():
|
def _build_diagnostic_ssh_command():
|
||||||
|
|
Загрузка…
Ссылка в новой задаче