mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
cmds.projects.CmdListRepos: Use new SSHClient API
Use SSHClient as an ExecContext, i.e. use the .run() method instead of .run_cmd(). Also, let SSHClient decide which implementation to use. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
a76a6c9316
commit
db9bf1826d
1 changed files with 3 additions and 3 deletions
|
|
@ -32,14 +32,14 @@ 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 SSHClientCmd as SSHClient
|
from jw.pkg.lib.SSHClient import ssh_client
|
||||||
ssh = SSHClient(hostname=url.hostname)
|
ssh = ssh_client(args.base_url)
|
||||||
if username is not None:
|
if username is not None:
|
||||||
ssh.set_username(username)
|
ssh.set_username(username)
|
||||||
if password is not None:
|
if password is not None:
|
||||||
ssh.set_password(password)
|
ssh.set_password(password)
|
||||||
cmd = ['/opt/jw-pkg/bin/git-srv-admin.sh', '-u', args.from_owner, '-j', 'list-personal-projects']
|
cmd = ['/opt/jw-pkg/bin/git-srv-admin.sh', '-u', args.from_owner, '-j', 'list-personal-projects']
|
||||||
stdout, stderr, code = await ssh.run_cmd(cmd)
|
stdout, stderr, code = await ssh.run(cmd)
|
||||||
print(stdout)
|
print(stdout)
|
||||||
return
|
return
|
||||||
case 'https':
|
case 'https':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue