Skip to content

Commit

Permalink
Send al VPC CNI logs to /dev/null by default (#2443)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLucian committed Sep 10, 2022
1 parent dbb2f7f commit 01719e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/client/cortex/binary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 01719e4

Please sign in to comment.