Merge pull request #926 from mwhudson/fix-ssh-option
fix --ssh option to client
This commit is contained in:
commit
7111efbd61
|
@ -283,19 +283,16 @@ class SubiquityClient(TuiApplication):
|
|||
self.interactive = status.interactive
|
||||
if self.interactive:
|
||||
if self.opts.ssh:
|
||||
ssh_info = self.client.meta.ssh_info.GET()
|
||||
if ssh_info is None:
|
||||
print("no ssh?")
|
||||
return
|
||||
ssh_info = await self.client.meta.ssh_info.GET()
|
||||
texts = ssh_help_texts(ssh_info)
|
||||
for line in texts:
|
||||
if hasattr(line, 'text'):
|
||||
if line.text.startswith('installer@'):
|
||||
print(' ' * 4 + line.text)
|
||||
else:
|
||||
print(line.text)
|
||||
else:
|
||||
print(line)
|
||||
import urwid
|
||||
if isinstance(line, urwid.Widget):
|
||||
line = '\n'.join([
|
||||
line.decode('utf-8').rstrip()
|
||||
for line in line.render((1000,)).text
|
||||
])
|
||||
print(line)
|
||||
return
|
||||
await super().start()
|
||||
journald_listen(
|
||||
|
|
|
@ -148,7 +148,7 @@ def ssh_help_texts(ssh_info):
|
|||
|
||||
texts = [_(SSH_HELP_PROLOGUE), ""]
|
||||
|
||||
if len(ssh_info.ips) > 0:
|
||||
if ssh_info is not None:
|
||||
if len(ssh_info.ips) > 1:
|
||||
texts.append(_(SSH_HELP_MULTIPLE_ADDRESSES))
|
||||
texts.append("")
|
||||
|
|
Loading…
Reference in New Issue