Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kinetic merge 2022-10-18 #1457

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion subiquity/client/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,17 @@ async def _answers_action(self, action):
raise Exception("could not process action {}".format(action))

async def _guided_choice(self, choice):
# FIXME It would seem natural here to pass the wait=true flag to the
# below HTTP calls, especially because we wrap the coroutine in
# wait_with_progress.
# Having said that, making the server return a cached result seems like
# the least risky option to address https://launchpad.net/bugs/1993257
# before the kinetic release. This is also similar to what we did for
# https://launchpad.net/bugs/1962205
if choice is not None:
coro = self.endpoint.guided.POST(choice)
else:
coro = self.endpoint.GET()
coro = self.endpoint.GET(use_cached_result=True)
status = await self.app.wait_with_progress(coro)
self.model = FilesystemModel(status.bootloader)
self.model.load_server_data(status)
Expand Down
4 changes: 3 additions & 1 deletion subiquity/common/apidef.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def POST(data: Payload[GuidedChoice]) \
-> StorageResponse:
pass

def GET(wait: bool = False) -> StorageResponse: ...
def GET(wait: bool = False, use_cached_result: bool = False) \
-> StorageResponse: ...

def POST(config: Payload[list]): ...

class reset:
Expand Down
10 changes: 6 additions & 4 deletions subiquity/server/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@ def _done_response(self):
dasd=self.model._probe_data.get('dasd', {}),
storage_version=self.model.storage_version)

async def GET(self, wait: bool = False) -> StorageResponse:
probe_resp = await self._probe_response(wait, StorageResponse)
if probe_resp is not None:
return probe_resp
async def GET(self, wait: bool = False, use_cached_result: bool = False) \
-> StorageResponse:
if not use_cached_result:
probe_resp = await self._probe_response(wait, StorageResponse)
if probe_resp is not None:
return probe_resp
return self._done_response()

async def POST(self, config: list):
Expand Down