From da6dd3af416d0d6f7cee8379a33b875f9a6b2d6e Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Sep 2022 09:35:25 +0200 Subject: [PATCH 1/2] ubuntu-pro: fix contract-selection callbacks signatures Signed-off-by: Olivier Gayot --- subiquity/client/controllers/ubuntu_pro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subiquity/client/controllers/ubuntu_pro.py b/subiquity/client/controllers/ubuntu_pro.py index e5397bee..f15bf052 100644 --- a/subiquity/client/controllers/ubuntu_pro.py +++ b/subiquity/client/controllers/ubuntu_pro.py @@ -160,7 +160,7 @@ class UbuntuProController(SubiquityTuiController): self._check_task.cancel() def contract_selection_initiate( - self, on_initiated: Callable[[str, str], None]) -> None: + self, on_initiated: Callable[[str], None]) -> None: """ Initiate the contract selection asynchronously. Calls on_initiated when the contract-selection has initiated. """ async def inner() -> None: @@ -172,7 +172,7 @@ class UbuntuProController(SubiquityTuiController): def contract_selection_wait( self, on_contract_selected: Callable[[str], None], - on_timeout: Callable[[None], None]) -> None: + on_timeout: Callable[[], None]) -> None: """ Asynchronously wait for the contract selection to finish. Calls on_contract_selected with the contract-token once the contract gets selected @@ -193,7 +193,7 @@ class UbuntuProController(SubiquityTuiController): self._monitor_task = schedule_task(inner()) def contract_selection_cancel( - self, on_cancelled: Callable[[None], None]) -> None: + self, on_cancelled: Callable[[], None]) -> None: """ Cancel the asynchronous contract selection (if started). """ async def inner() -> None: await self.endpoint.contract_selection.cancel.POST() From 003127054fde7bf0c586d47458b4cf740db2de1e Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Sep 2022 09:37:01 +0200 Subject: [PATCH 2/2] ubuntu-pro: don't use keyword arguments for callables Signed-off-by: Olivier Gayot --- subiquity/client/controllers/ubuntu_pro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subiquity/client/controllers/ubuntu_pro.py b/subiquity/client/controllers/ubuntu_pro.py index f15bf052..bb5b82b5 100644 --- a/subiquity/client/controllers/ubuntu_pro.py +++ b/subiquity/client/controllers/ubuntu_pro.py @@ -166,7 +166,7 @@ class UbuntuProController(SubiquityTuiController): async def inner() -> None: answer = await self.endpoint.contract_selection.initiate.POST() self.cs_initiated = True - on_initiated(user_code=answer.user_code) + on_initiated(answer.user_code) self._magic_attach_task = schedule_task(inner()) def contract_selection_wait(