From 01719e48f67213b899abd63b3320c39ecaa57587 Mon Sep 17 00:00:00 2001 From: Robert Lucian Chiriac Date: Sat, 10 Sep 2022 03:12:39 +0300 Subject: [PATCH] Send al VPC CNI logs to /dev/null by default (#2443) --- 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,