Skip to content

Commit

Permalink
Merge pull request #1457 from ogayot/kinetic-merge-2022-10-18
Browse files Browse the repository at this point in the history
Kinetic merge 2022-10-18
  • Loading branch information
dbungert authored Oct 18, 2022
2 parents b852a5d + 054c00f commit ee73c4d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
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

0 comments on commit ee73c4d

Please sign in to comment.