lib.ec.SSHClient.__init__(): Add parameter caps

Add an optional caps ("capabilities") argument to the constructor of
SSHClient. It is meant to be used by derived classes in order to
declare that they don't want the base class to handle a default
behaviour for a certain capability, but that they want to implement
it themselves instead.

Also, give the _run_ssh() callbacks the necessary info as parameters,
so that the derived classes have the means to do so.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-21 03:41:10 +01:00
commit 3a84408436
3 changed files with 36 additions and 8 deletions

View file

@ -39,7 +39,7 @@ class Exec(Base): # export
self.__askpass_orig[key] = os.getenv(key)
os.environ[key] = val
async def _run_ssh(self, cmd: list[str], cmd_input: str|None) -> Result:
async def _run_ssh(self, cmd: list[str], cmd_input: str|None, *args, **kwargs) -> Result:
self.__init_askpass()
return await run_cmd(['ssh', self.hostname, shlex.join(cmd)], cmd_input=cmd_input)