Skip to content

Commit

Permalink
Drop the confirm_ssh_keys call if UI not as expected (#941)
Browse files Browse the repository at this point in the history
* Drop the confirm_ssh_keys call if UI not as expected

There is a larger problem here of the UI body changing underneath of us,
but this is at least a baby step in the right direction.
Also this matches existing client/controllers/ssh.py behavior.
At least log the event when it happens.
LP: #1925048

* lint
  • Loading branch information
dbungert authored Apr 19, 2021
1 parent 4b5fd53 commit 046949f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions subiquity/client/controllers/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ async def _fetch_ssh_keys(self, *, context, ssh_import_id, ssh_data):
ssh_data.authorized_keys = key_material.splitlines()
self.done(ssh_data)
else:
self.ui.body.confirm_ssh_keys(
ssh_data, ssh_import_id, key_material, fingerprints)
if isinstance(self.ui.body, SSHView):
self.ui.body.confirm_ssh_keys(
ssh_data, ssh_import_id, key_material, fingerprints)
else:
log.debug("ui.body of unexpected instance: %s",
type(self.ui.body).__name__)

def fetch_ssh_keys(self, ssh_import_id, ssh_data):
self._fetch_task = schedule_task(
Expand Down

0 comments on commit 046949f

Please sign in to comment.