App: Support --uri <remote-host>

Add a --uri option to App, allowing jw-pkg.py to operate over the
wire.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-18 07:10:21 +01:00
commit d905f6d555

View file

@ -246,6 +246,7 @@ class App(Base):
parser.add_argument('--distro-id', default=None, help='Distribution ID (default is taken from /etc/os-release)')
parser.add_argument('--interactive', choices=['true', 'false', 'auto'], default='true', help="Wait for user input or try to proceed unattended")
parser.add_argument('--verbose', action='store_true', default=False, help="Be verbose on stderr about what's being done on the distro level")
parser.add_argument('--uri', default='local', help="Run commands on this host")
async def _run(self, args: argparse.Namespace) -> None:
self.__opt_os = args.os
@ -282,8 +283,9 @@ class App(Base):
@property
def exec_context(self) -> str:
if self.__exec_context is None:
from .lib.ec.Local import Local
self.__exec_context = Local(interactive=self.interactive, verbose_default=self.verbose)
from .lib.ExecContext import ExecContext
self.__exec_context = ExecContext.create(self.args.uri, interactive=self.interactive,
verbose_default=self.verbose)
return self.__exec_context
@property