Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Feature: match cluster submit exit code in cli #478

Merged
merged 2 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion aztk_cli/spark/endpoints/cluster/cluster_submit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import sys
import typing
from aztk_cli import utils, config, log
import aztk.spark
Expand Down Expand Up @@ -140,4 +141,6 @@ def execute(args: typing.NamedTuple):
)

if args.wait:
utils.stream_logs(client=spark_client, cluster_id=args.cluster_id, application_name=args.name)
exit_code = utils.stream_logs(client=spark_client, cluster_id=args.cluster_id, application_name=args.name)
sys.exit(exit_code)

2 changes: 1 addition & 1 deletion aztk_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def stream_logs(client, cluster_id, application_name):
current_bytes=current_bytes)
print(app_logs.log, end="")
if app_logs.application_state == 'completed':
break
return app_logs.exit_code
current_bytes = app_logs.total_bytes
time.sleep(3)

Expand Down