7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 284eb30ecf | |||
| 989e2c93e3 | |||
| d0776db01f | |||
| 565946643b | |||
| b81406e11a | |||
| 4274a71c62 | |||
| 2e69639362 |
Renamed from src/python/jw/pkg/build/lib/SSHClient.py (Browse further)
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 284eb30ecf |
lib.SSHClient: Derive from ExecContext
Make SSHClient an ExecContext by implementing _run() and _sudo(). Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 989e2c93e3 |
lib.SSHClient.run_cmd(): Align prototype with EC
Align the prototype of SSHClient.run_cmd() to ExecContext.run(). This is a push towards making the SSHClient code an ExceContext, too. Some arguments still log a warning or outright raise NotImplementedError. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| d0776db01f |
lib.SSHClient.run_cmd(): Accept cmd: list[str]
Make SSHClient accept a list of strings for the cmd argument to align with the other run_cmd() functions in jw-pkg. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 565946643b |
jw.pkg.*.run_xxx(): Return exit status
Most run_xxx() return stdout and stderr. There's no way, really, for the caller to get hold of the exit code of the spawned executable. It can pass throw=true, catch, and assume a non-zero exit status. But that's not semantically clean, since the spawned function can well be a test function which is expected to return a non-zero status code, and the caller might be interested in what code that was, exactly. The clearest way to solve this is to return the exit code as well. This commit does that. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| b81406e11a |
run_cmd() and friends: Make args a list[str]
This is a code maintenance commit: some run_xxx() helper functions take a string, some a list, and some just digest all arguments and pass them on as a list to exec() to be executed. That's highly inconsistent. This commit changes that to list-only. Except for the run_cmd() method of SSHClient, which is still run as a shell method, because, erm, it's a shell. Might be changed in the future for consistency reasons. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 4274a71c62 |
lib.util.run_cmd(): Rewrite it to be async
run_cmd() is synchronous. Now that all commands are asynchronous, we can await it, so rewrite it to be asynchronous, too. Other changes: - Make it return stderr as well in case its needed - Drop into a pseuto-tty if
- cmd_input == "mode:interactive" or
- cmd_input == "mode:auto" and stdin is a TTY - Add argument env, defaulting to None. If it's a dict, it will be
the environment the command is run in This entails making all functions using run_cmd() async, too, including run_curl(), get_username() and get_password(). Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 2e69639362 |
jw.pkg.build.lib: Move to jw.pkg.lib
In preparation of reorganizing the tree below cmds, move the lib subdirectory a level up. Signed-off-by: Jan Lindemann <jan@janware.com> |