mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
lib.ec.ssh.Exec: Fix cmd_input == None
cmd_input is passed as None to _run(), which is legal, but then used in a call to cmd_run(), which is a public API and, hence, illegal. Fix that. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
6658d6e9e7
commit
f78d08f0d8
1 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...base import InputMode
|
||||
from ...util import run_cmd
|
||||
from ..SSHClient import SSHClient as Base
|
||||
from .util import join_cmd
|
||||
|
|
@ -40,5 +41,6 @@ class Exec(Base):
|
|||
|
||||
async def _run_ssh(self, cmd: list[str], cmd_input: bytes|None, *args, **kwargs) -> Result:
|
||||
self.__init_askpass()
|
||||
if cmd_input is None:
|
||||
cmd_input = InputMode.Interactive if self.interactive else InputMode.NonInteractive
|
||||
return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive, throw=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue