mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52dd3b8f21 | |||
| 888c1e7f16 | |||
| 72bd5e3555 | |||
| 1325222fbd | |||
| fadf1bca49 | |||
| 3e897f4df8 |
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 52dd3b8f21 |
lib.ExecContext.run(): Push code up into base class
Take implementation burden from the derived classes _run() callback by moving the respective code into the run() wrapper methods of the base class. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 888c1e7f16 |
lib.ExecContext.__init__(): Add parameter uri
Take a positional uri argument to the constructor of ExecContext, forcing SSHClient to follow suit. The latter was instantiated with a hostname as only argument up to now, which still works as a special case of an uri. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 72bd5e3555 |
lib.Local.run(): Be less dramatic about exit != 0
Don't mention "error" in log message for exit codes > 0 from spawned processes, because sometimes they don't mean an error. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 1325222fbd |
lib.ExecContext,Local: Remove callback default params
Remove defaults from protected callback function parameters. They have to be decided by the base class's public API. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| fadf1bca49 |
lib.util.run_cmd(): Add parameter ec: ExecContext
Allow to specify the ExecContext in a call to run_cmd(). This effectively makes run_cmd() an thin wrapper around ExecContext.run(), which is what's going to be used in the future. The wrapper is for backwards-compatibility. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 3e897f4df8 |
lib.Distro, ExecContext: Add classes, refactor lib.distro
The code below lib.distro, as left behind by the previous commit, is geared towards being directly used as a command-line API. This commit introduces the abstract base class Distro, a proxy for distribution-specific interactions. The proxy abstracts distro specifics into an API with proper method prototypes, not argparse.Namespace contents, and can thus be more easily driven by arbitrary code. The Distro class is initialized with a member variable of type ExecContext, another new class introduced by this commit. It is designed to abstract the communication channel to the distribution instance. Currently only one specialization exists, Local, which interacts with the distribution and root file system it is running in, but is planned to be subclassed to support interaction via SSH, serial, chroot, or chains thereof. Signed-off-by: Jan Lindemann <jan@janware.com> |