mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
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:
parent
76b702f5b4
commit
d905f6d555
1 changed files with 4 additions and 2 deletions
|
|
@ -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('--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('--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('--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:
|
async def _run(self, args: argparse.Namespace) -> None:
|
||||||
self.__opt_os = args.os
|
self.__opt_os = args.os
|
||||||
|
|
@ -282,8 +283,9 @@ class App(Base):
|
||||||
@property
|
@property
|
||||||
def exec_context(self) -> str:
|
def exec_context(self) -> str:
|
||||||
if self.__exec_context is None:
|
if self.__exec_context is None:
|
||||||
from .lib.ec.Local import Local
|
from .lib.ExecContext import ExecContext
|
||||||
self.__exec_context = Local(interactive=self.interactive, verbose_default=self.verbose)
|
self.__exec_context = ExecContext.create(self.args.uri, interactive=self.interactive,
|
||||||
|
verbose_default=self.verbose)
|
||||||
return self.__exec_context
|
return self.__exec_context
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue