clan-cli: cmd.run now has its options extracted to a dataclass
This commit is contained in:
@@ -9,7 +9,7 @@ from pathlib import Path
|
||||
from shlex import quote
|
||||
from typing import IO, Any
|
||||
|
||||
from clan_cli.cmd import CmdOut, Log, MsgColor
|
||||
from clan_cli.cmd import CmdOut, Log, MsgColor, RunOpts
|
||||
from clan_cli.cmd import run as local_run
|
||||
from clan_cli.colors import AnsiColor
|
||||
from clan_cli.ssh.host_key import HostKeyCheck
|
||||
@@ -68,19 +68,21 @@ class Host:
|
||||
) -> CmdOut:
|
||||
res = local_run(
|
||||
cmd,
|
||||
shell=shell,
|
||||
stdout=stdout,
|
||||
prefix=self.command_prefix,
|
||||
timeout=timeout,
|
||||
stderr=stderr,
|
||||
input=input,
|
||||
env=env,
|
||||
cwd=cwd,
|
||||
log=log,
|
||||
check=check,
|
||||
error_msg=error_msg,
|
||||
msg_color=msg_color,
|
||||
needs_user_terminal=needs_user_terminal,
|
||||
RunOpts(
|
||||
shell=shell,
|
||||
stdout=stdout,
|
||||
prefix=self.command_prefix,
|
||||
timeout=timeout,
|
||||
stderr=stderr,
|
||||
input=input,
|
||||
env=env,
|
||||
cwd=cwd,
|
||||
log=log,
|
||||
check=check,
|
||||
error_msg=error_msg,
|
||||
msg_color=msg_color,
|
||||
needs_user_terminal=needs_user_terminal,
|
||||
),
|
||||
)
|
||||
return res
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import tarfile
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
|
||||
from clan_cli.cmd import Log
|
||||
from clan_cli.cmd import Log, RunOpts
|
||||
from clan_cli.cmd import run as run_local
|
||||
from clan_cli.errors import ClanError
|
||||
from clan_cli.ssh.host import Host
|
||||
@@ -77,8 +77,10 @@ def upload(
|
||||
with tar_path.open("rb") as f:
|
||||
run_local(
|
||||
cmd,
|
||||
input=f.read(),
|
||||
log=Log.BOTH,
|
||||
prefix=host.command_prefix,
|
||||
needs_user_terminal=True,
|
||||
RunOpts(
|
||||
input=f.read(),
|
||||
log=Log.BOTH,
|
||||
prefix=host.command_prefix,
|
||||
needs_user_terminal=True,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user