From ed78b129cedaa5964892d7b6b45f1b66a0cc40fa Mon Sep 17 00:00:00 2001 From: Robert Lucian Chiriac Date: Fri, 9 Sep 2022 19:59:44 +0300 Subject: [PATCH] Send al VPC CNI logs to /dev/null by default --- python/client/cortex/binary/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/client/cortex/binary/__init__.py b/python/client/cortex/binary/__init__.py index 9eeb7ffffd..1442faa160 100644 --- a/python/client/cortex/binary/__init__.py +++ b/python/client/cortex/binary/__init__.py @@ -25,7 +25,10 @@ def run(): Runs the CLI from terminal. """ try: - process = subprocess.run([get_cli_path()] + sys.argv[1:], cwd=os.getcwd()) + env = os.environ.copy() + if "AWS_VPC_K8S_CNI_LOG_FILE" not in env: + env["AWS_VPC_K8S_CNI_LOG_FILE"] = "/dev/null" + process = subprocess.run([get_cli_path()] + sys.argv[1:], cwd=os.getcwd(), env=env) except KeyboardInterrupt: sys.exit(130) # Ctrl + C sys.exit(process.returncode) @@ -51,6 +54,8 @@ def run_cli( env = os.environ.copy() env["CORTEX_CLI_INVOKER"] = "python" + if "AWS_VPC_K8S_CNI_LOG_FILE" not in env: + env["AWS_VPC_K8S_CNI_LOG_FILE"] = "/dev/null" process = subprocess.Popen( [get_cli_path()] + args, stderr=subprocess.PIPE,