You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/04/30 23:54:13 UTC

[airflow] 08/09: When exec fails in breeze we do not print stack-trace (#23342)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 8430808567ca87ae265cee77903f1a692f9357ba
Author: Jarek Potiuk <ja...@polidea.com>
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.
    
    (cherry picked from commit e5ac9d8d0bb1c6b6ac7570d572acff2e86b8a29d)
---
 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