mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
lib.ec.ssh.Exec: Honour self.interactive
The Exec SSHClient ignores the "interactive" argument passed to its constructor, fix that. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
84375cd482
commit
bafc7fed2a
2 changed files with 3 additions and 3 deletions
|
|
@ -40,5 +40,5 @@ class Exec(Base):
|
|||
|
||||
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, join_cmd(cmd)], cmd_input=cmd_input)
|
||||
return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ def pretty_cmd(cmd: list[str], wd=None):
|
|||
return ret
|
||||
|
||||
# See ExecContext.run() for what this function does
|
||||
async def run_cmd(*args, ec: ExecContext|None=None, verbose: bool|None=None, **kwargs) -> Result:
|
||||
async def run_cmd(*args, ec: ExecContext|None=None, verbose: bool|None=None, interactive: bool=False, **kwargs) -> Result:
|
||||
if verbose is None:
|
||||
verbose = False if ec is None else ec.verbose_default
|
||||
if ec is None:
|
||||
from .ec.Local import Local
|
||||
ec = Local(verbose_default=verbose)
|
||||
ec = Local(verbose_default=verbose, interactive=interactive)
|
||||
return await ec.run(verbose=verbose, *args, **kwargs)
|
||||
|
||||
async def run_curl(args: list[str], parse_json: bool=False, wd=None, throw=None, verbose=None, cmd_input=None, ec: ExecContext|None=None, decode=False) -> dict|str: # export
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue