From 626e5558f3697008d8f3e31b3d0d131ea1b837bf Mon Sep 17 00:00:00 2001 From: Qubasa Date: Wed, 10 Jan 2024 17:31:11 +0100 Subject: [PATCH] Fix cmd to default print on all outputs. Default print on stderr --- pkgs/clan-cli/clan_cli/cmd.py | 2 +- pkgs/clan-cli/tests/test_machines_cli.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/cmd.py b/pkgs/clan-cli/clan_cli/cmd.py index a75d20809..d9534c164 100644 --- a/pkgs/clan-cli/clan_cli/cmd.py +++ b/pkgs/clan-cli/clan_cli/cmd.py @@ -55,7 +55,7 @@ def handle_output(process: subprocess.Popen, log: Log) -> tuple[str, str]: return stdout_buf.decode("utf-8"), stderr_buf.decode("utf-8") -def run(cmd: list[str], cwd: Path = Path.cwd(), log: Log = Log.BOTH) -> CmdOut: +def run(cmd: list[str], cwd: Path = Path.cwd(), log: Log = Log.STDERR) -> CmdOut: # Start the subprocess process = subprocess.Popen( cmd, cwd=str(cwd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True diff --git a/pkgs/clan-cli/tests/test_machines_cli.py b/pkgs/clan-cli/tests/test_machines_cli.py index 2b0832e7c..325f45e23 100644 --- a/pkgs/clan-cli/tests/test_machines_cli.py +++ b/pkgs/clan-cli/tests/test_machines_cli.py @@ -14,6 +14,7 @@ def test_machine_subcommands( capsys.readouterr() cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"]) + out = capsys.readouterr() assert "machine1\nvm1\nvm2\n" == out.out