Commit Graph

54 Commits

Author SHA1 Message Date
Qubasa
65a5789c5b clan-cli: Replace HostGroup and MachineGroup with generic AsyncRuntime class. Propagate cmd prefix over thread local. Close threads on CTRL+C 2024-12-09 18:07:23 +01:00
Qubasa
daf8033c25 clan-cli: made run_no_stdout runOpts compatible and make time table thread safe 2024-12-06 12:18:28 +01:00
Jörg Thalheim
041547b317 no longer show prefix 2024-12-04 12:14:32 +01:00
Jörg Thalheim
bbb2aca5cb rename run_no_output to run_no_stdout
we want stderr for some nix commands.
2024-12-03 17:15:28 +01:00
Qubasa
570bceff4e clan-cli: Fix ignored debug flag in clan vms run, refactor Host.run to use RunOpts 2024-12-03 16:01:51 +01:00
Qubasa
1f98df96e3 clan-cli: cmd.run now has its options extracted to a dataclass 2024-11-28 15:26:37 +01:00
Qubasa
80045a9af1 clan-cli: Add -L option to nixos-rebuild switch to still have build output, simplify logging code 2024-11-28 10:42:43 +01:00
Qubasa
a1a367c57c clan-cli: Refactor colors to a subset of colors that work in light and dark mode 2024-11-27 12:42:10 +01:00
Qubasa
979e5e839d clan-cli: Refactor ssh part 2, Refactor custom_logger 2024-11-22 22:08:50 +01:00
Qubasa
26730cd662 clan-cli: upload.py -> Replace rsync with native ssh command 2024-11-15 22:03:47 +07:00
a-kenji
edd7253dea pkgs/cli: Fix typo in comment 2024-11-14 10:17:44 +01:00
Jörg Thalheim
616ddca734 cmd: also process stdin 2024-11-13 13:23:42 +01:00
Qubasa
d3f0107f4d clan-cli: Improved --debug output by indenting commands, add TRACE_DEPTH environment variable 2024-11-11 21:23:53 +07:00
Jörg Thalheim
b3d2be1f28 fix resource leak in case need_user_terminal is used 2024-10-29 13:54:12 +01:00
DavHau
08fb34aa01 cli: set needs_user_terminal for all ssh commands 2024-10-23 19:40:50 +07:00
DavHau
4c6acf2301 cmd.run: add needs_user_terminal to unbreak sudo 2024-10-23 17:37:54 +07:00
Jörg Thalheim
5b1070e7a7 use actual performance timer to measure how long a process takes 2024-10-10 17:59:56 +02:00
Jörg Thalheim
6122839f90 improve terminating processes on error 2024-10-10 17:59:26 +02:00
Jörg Thalheim
887ef9b2c8 cmd/run: remove unnecessary wait 2024-10-08 17:51:55 +00:00
Qubasa
a80d7cc3f0 clan-cli: Improve CmdOut output 2024-10-07 01:36:40 +02:00
Jörg Thalheim
4207aef029 don't leak memory in global table unless we want to record performance 2024-10-01 19:32:00 +02:00
Jörg Thalheim
13aed0792e fix file descriptor leak in cmd.run()
we were leaking pipes.
2024-10-01 19:27:47 +02:00
Jörg Thalheim
cb16cda3fa add RET, Q, RSE lint 2024-09-02 15:58:49 +02:00
Jörg Thalheim
e150b37fb8 enable ASYNC, DTZ, YTT and EM lints 2024-09-02 14:07:06 +02:00
Jörg Thalheim
109d1faf9e enable bug-bear linting rules 2024-09-02 13:26:07 +02:00
lassulus
05ed378199 Revert "clan-cli: cmd.py uses pseudo terminal now. Remove tty.py. Refactor password_store.py to use cmd.py."
This reverts commit 58f5bc0be0.
2024-06-03 12:25:20 +02:00
Qubasa
58f5bc0be0 clan-cli: cmd.py uses pseudo terminal now. Remove tty.py. Refactor password_store.py to use cmd.py. 2024-06-02 16:52:31 +02:00
Qubasa
cca39c4839 clan-cli: Refactor machines/update.py to cmd.run 2024-06-02 10:00:23 +02:00
Qubasa
44660056f1 clan-cli: Refactor subprocess.run to cmd.run. tea-create-pr: Fix missing fail-on-change for treefmt 2024-06-02 09:53:24 +02:00
a-kenji
12add74aae clan: add run_no_stdout function suppressing stdout
Add the `run_no_stdout` function suppressing stdout by default.This
keeps the noise down on most commands, while still
stayingdebuggable.Stdout will be active when the `--debug` flag is
passed to the cli.

Fixes #1443
2024-05-28 11:13:55 +02:00
Qubasa
93ca333227 clan_cli: Add TimeTable class to cmd.py. Fix bugs in Machine rewrite 2024-03-08 22:01:54 +07:00
Qubasa
043f2e5061 clan_cli,clan_vm_manager: Moved profiler to clan_cli. Add cmd timer to see how long run commands take 2024-03-06 17:12:20 +07:00
Jörg Thalheim
7b60678d1f cmd: skip print for zero-length bufs 2024-01-30 10:30:25 +07:00
Jörg Thalheim
a83d7e0afc cmd: add a timeout in select 2024-01-12 00:20:22 +01:00
Qubasa
12896d72ea cmd.py: Fix busy loop. 2024-01-12 00:13:21 +01:00
Qubasa
b4a3be7628 Re-added rlist.remove to counter busy loop 2024-01-12 00:08:15 +01:00
Qubasa
c56e1d1684 cmd.py: Fix deadlock because of incorrect select usage 2024-01-11 23:03:14 +01:00
Qubasa
f087f527cc Removed duplicate logging messages 2024-01-11 22:46:29 +01:00
Qubasa
2c6c4bacce Identified deadlocking funciton 2024-01-11 22:28:35 +01:00
Qubasa
6647c38417 Working test_secrets_generate 2024-01-11 21:48:39 +01:00
Qubasa
038aa769aa cmd.py: Fixing bug: missing output because of forgotten flush() call 2024-01-11 21:11:49 +01:00
Qubasa
13ba1440bd cmd.py refactor part 4 2024-01-11 21:11:49 +01:00
Qubasa
50781d6cf0 Fixed bug, where exception is raised where there shouldn't be raised one 2024-01-10 18:46:54 +01:00
Qubasa
cbc4c966f1 Added ClanCmdError. cmd.run now returns this error 2024-01-10 17:58:39 +01:00
Qubasa
2f9195b779 Fix cmd to default print on all outputs. Default print on stderr 2024-01-10 17:31:11 +01:00
Qubasa
715ed10e59 nix fmt 2024-01-10 17:19:33 +01:00
Qubasa
cc6f9e67fa nix fmt 2024-01-10 17:19:12 +01:00
Qubasa
6f27cd8b6a Updated cmd.py with Mic92 changes to fit previous changes 2024-01-10 17:18:21 +01:00
Qubasa
7049573d28 Refactor subprocess to cmd.py part 2 2024-01-10 12:11:29 +01:00
Jörg Thalheim
b476f6386d cmd: rework redirecting stdout/stderr 2024-01-09 17:34:43 +01:00