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/07/25 15:47:43 UTC

[airflow] branch main updated: Avoid unnecessary error output when checking for emulated environment (#25289)

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 8bd5c8f6b1 Avoid unnecessary error output when checking for emulated environment (#25289)
8bd5c8f6b1 is described below

commit 8bd5c8f6b18da135de01532d45df6403ec98f30c
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Mon Jul 25 17:47:34 2022 +0200

    Avoid unnecessary error output when checking for emulated environment (#25289)
    
    The #25229 introduced check for emulated environment, but
    it introduced a warning being printed on Linux environment.
    
    This avoids printing the warning and also it stops running the check
    outside of MacOS (Darwin)
---
 dev/breeze/src/airflow_breeze/commands/main_command.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/main_command.py b/dev/breeze/src/airflow_breeze/commands/main_command.py
index 13ea840ce0..fbf3b38067 100644
--- a/dev/breeze/src/airflow_breeze/commands/main_command.py
+++ b/dev/breeze/src/airflow_breeze/commands/main_command.py
@@ -106,9 +106,13 @@ def check_for_python_emulation():
 
 
 def check_for_rosetta_environment():
+    if sys.platform != 'darwin':
+        return
     try:
         runs_in_rosetta = subprocess.check_output(
-            ["sysctl", "-n", "sysctl.proc_translated"], text=True
+            ["sysctl", "-n", "sysctl.proc_translated"],
+            text=True,
+            stderr=subprocess.DEVNULL,
         ).strip()
         if runs_in_rosetta == '1':
             from airflow_breeze.utils.console import get_console