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

Commit

Permalink
Feature: match cluster submit exit code in cli (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
jafreck authored Apr 5, 2018
1 parent a59fe8b commit 8889059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 8889059

Please sign in to comment.