From 2708ed21e58622938cb624b6419206f6f17c4066 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 14 Jan 2022 11:29:28 +0100 Subject: [PATCH] Fix typing for ubuntu advantage services Signed-off-by: Olivier Gayot --- subiquity/common/ubuntu_advantage.py | 2 +- subiquity/ui/views/ubuntu_advantage.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subiquity/common/ubuntu_advantage.py b/subiquity/common/ubuntu_advantage.py index cf9d61e4..f05ba632 100644 --- a/subiquity/common/ubuntu_advantage.py +++ b/subiquity/common/ubuntu_advantage.py @@ -147,7 +147,7 @@ class UAInterface: """ Return a dictionary containing the subscription information. """ return await self.strategy.query_info(token) - async def get_avail_services(self, token: str) -> list: + async def get_avail_services(self, token: str) -> List[dict]: """ Return a list of available services for the subscription associated with the token provided. """ diff --git a/subiquity/ui/views/ubuntu_advantage.py b/subiquity/ui/views/ubuntu_advantage.py index 01e9245e..ee171738 100644 --- a/subiquity/ui/views/ubuntu_advantage.py +++ b/subiquity/ui/views/ubuntu_advantage.py @@ -189,7 +189,7 @@ class UbuntuAdvantageView(BaseView): self.remove_overlay() self.show_stretchy_overlay(ContinueAnywayWidget(self)) - def show_available_services(self, services: dict) -> None: + def show_available_services(self, services: List[dict]) -> None: """ Display an overlay with the list of services that will be enabled via Ubuntu Advantage subscription. After the user confirms, the next we will quit the current view and move on. """ @@ -199,7 +199,8 @@ class UbuntuAdvantageView(BaseView): class ShowServicesWidget(Stretchy): """ Widget to show the available services for UA subscription. """ - def __init__(self, parent: UbuntuAdvantageView, services: list): + def __init__(self, parent: UbuntuAdvantageView, + services: List[dict]) -> None: """ Initializes the widget by including the list of services as a bullet-point list. """ self.parent = parent