This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e5ac9d8d0b When exec fails in breeze we do not print stack-trace
(#23342)
e5ac9d8d0b is described below
commit e5ac9d8d0bb1c6b6ac7570d572acff2e86b8a29d
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Apr 30 11:13:34 2022 +0200
When exec fails in breeze we do not print stack-trace (#23342)
When you run exec and breeze is not running, there was a stack
trace printed rather than straightforward error message.
This fixes it - stacktrace is only printed now when verbose is
used. If not just error message is printed.
---
dev/breeze/src/airflow_breeze/shell/enter_shell.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/shell/enter_shell.py
b/dev/breeze/src/airflow_breeze/shell/enter_shell.py
index b7f9da4e58..3f6ff5b1b2 100644
--- a/dev/breeze/src/airflow_breeze/shell/enter_shell.py
+++ b/dev/breeze/src/airflow_breeze/shell/enter_shell.py
@@ -152,18 +152,14 @@ def find_airflow_container(verbose, dry_run) ->
Optional[str]:
env_variables =
construct_env_variables_docker_compose_command(exec_shell_params)
cmd = ['docker-compose', 'ps', '--all', '--filter', 'status=running',
'airflow']
docker_compose_ps_command = run_command(
- cmd,
- verbose=verbose,
- dry_run=dry_run,
- text=True,
- capture_output=True,
- env=env_variables,
- # print output if run in verbose mode to better diagnose problems.
- no_output_dump_on_exception=not verbose,
+ cmd, verbose=verbose, dry_run=dry_run, text=True, capture_output=True,
env=env_variables, check=False
)
if dry_run:
return "CONTAINER_ID"
if docker_compose_ps_command.returncode != 0:
+ if verbose:
+ get_console().print(docker_compose_ps_command.stdout)
+ get_console().print(docker_compose_ps_command.stderr)
stop_exec_on_error(docker_compose_ps_command.returncode)
return None