From 3ac1810b0cc489b9d7abdcfb6531a9d40ad703ef Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 8 Feb 2024 11:26:52 +0100 Subject: [PATCH] ssh: use view-helpers for detecting the confirmation key overlay Signed-off-by: Olivier Gayot --- subiquity/client/controllers/ssh.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/subiquity/client/controllers/ssh.py b/subiquity/client/controllers/ssh.py index b8d32231..985ec836 100644 --- a/subiquity/client/controllers/ssh.py +++ b/subiquity/client/controllers/ssh.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import asyncio import logging from subiquity.client.controller import SubiquityTuiController @@ -76,15 +75,9 @@ class SSHController(SubiquityTuiController): import_form._click_done(None) # Wait until the key gets fetched - while True: - try: - confirm_overlay = self.ui.body._w.stretchy - except AttributeError: - pass - else: - if isinstance(confirm_overlay, ConfirmSSHKeys): - break - await asyncio.sleep(0.01) + confirm_overlay = await view_helpers.wait_for_overlay( + self.ui, ConfirmSSHKeys + ) confirm_overlay.ok(None)