ssh: use view-helpers for detecting the confirmation key overlay

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2024-02-08 11:26:52 +01:00
parent 5861968e80
commit 3ac1810b0c
1 changed files with 3 additions and 10 deletions

View File

@ -13,7 +13,6 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import asyncio
import logging import logging
from subiquity.client.controller import SubiquityTuiController from subiquity.client.controller import SubiquityTuiController
@ -76,15 +75,9 @@ class SSHController(SubiquityTuiController):
import_form._click_done(None) import_form._click_done(None)
# Wait until the key gets fetched # Wait until the key gets fetched
while True: confirm_overlay = await view_helpers.wait_for_overlay(
try: self.ui, ConfirmSSHKeys
confirm_overlay = self.ui.body._w.stretchy )
except AttributeError:
pass
else:
if isinstance(confirm_overlay, ConfirmSSHKeys):
break
await asyncio.sleep(0.01)
confirm_overlay.ok(None) confirm_overlay.ok(None)