mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
lib.SSHClient: Move to lib.ec
SSHClient in an ExecContext, hence it's better off in lib.ec, move it there and adapt the references. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
54a6053cc2
commit
f37f025b17
3 changed files with 5 additions and 5 deletions
|
|
@ -32,7 +32,7 @@ class CmdListRepos(Cmd): # export
|
||||||
match url.scheme:
|
match url.scheme:
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
if re.match(r'ssh://.*git\.janware\.com/', args.base_url):
|
if re.match(r'ssh://.*git\.janware\.com/', args.base_url):
|
||||||
from jw.pkg.lib.SSHClient import ssh_client
|
from jw.pkg.lib.ec.SSHClient import ssh_client
|
||||||
ssh = ssh_client(args.base_url)
|
ssh = ssh_client(args.base_url)
|
||||||
if username is not None:
|
if username is not None:
|
||||||
ssh.set_username(username)
|
ssh.set_username(username)
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ class ExecContext(abc.ABC):
|
||||||
from .ec.Local import Local
|
from .ec.Local import Local
|
||||||
return Local(uri, *args, **kwargs)
|
return Local(uri, *args, **kwargs)
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
from .SSHClient import ssh_client
|
from .ec.SSHClient import ssh_client
|
||||||
return ssh_client(uri, *args, **kwargs)
|
return ssh_client(uri, *args, **kwargs)
|
||||||
case _:
|
case _:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ from typing import Any
|
||||||
|
|
||||||
import os, abc, shlex, sys
|
import os, abc, shlex, sys
|
||||||
|
|
||||||
from .util import run_cmd, pretty_cmd
|
from ..util import run_cmd, pretty_cmd
|
||||||
from .log import *
|
from ..log import *
|
||||||
from .ExecContext import ExecContext, Result
|
from ..ExecContext import ExecContext, Result
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
class SSHClient(ExecContext):
|
class SSHClient(ExecContext):
|
||||||
Loading…
Add table
Add a link
Reference in a new issue