From afe21993d98c4ddd7df086e5b219578f0f33f036 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 31 Mar 2021 20:18:22 +1300 Subject: [PATCH] fix --ssh option to client --- subiquity/client/client.py | 19 ++++++++----------- subiquity/ui/views/help.py | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/subiquity/client/client.py b/subiquity/client/client.py index d19386f0..8bc21f0a 100644 --- a/subiquity/client/client.py +++ b/subiquity/client/client.py @@ -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( diff --git a/subiquity/ui/views/help.py b/subiquity/ui/views/help.py index 233002f8..10809bbe 100644 --- a/subiquity/ui/views/help.py +++ b/subiquity/ui/views/help.py @@ -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("")