ssh: drop redundant use of context when importing key

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2024-02-08 10:33:37 +01:00
parent f5ecece153
commit 0f3c53c283
1 changed files with 19 additions and 24 deletions

View File

@ -100,10 +100,7 @@ class SSHController(SubiquityTuiController):
@with_context(name="ssh_import_id", description="{ssh_import_id}")
async def _fetch_ssh_keys(self, *, context, ssh_import_id):
with self.context.child("ssh_import_id", ssh_import_id):
response: SSHFetchIdResponse = await self.endpoint.fetch_id.GET(
ssh_import_id
)
response: SSHFetchIdResponse = await self.endpoint.fetch_id.GET(ssh_import_id)
if response.status == SSHFetchIdStatus.IMPORT_ERROR:
if isinstance(self.ui.body, SSHView):
@ -124,9 +121,7 @@ class SSHController(SubiquityTuiController):
if isinstance(self.ui.body, SSHView):
self.ui.body.confirm_ssh_keys(ssh_import_id, identities)
else:
log.debug(
"ui.body of unexpected instance: %s", type(self.ui.body).__name__
)
log.debug("ui.body of unexpected instance: %s", type(self.ui.body).__name__)
def fetch_ssh_keys(self, ssh_import_id):
self._fetch_task = schedule_task(