diff --git a/subiquity/client/controllers/filesystem.py b/subiquity/client/controllers/filesystem.py index 02c120f83..83b37b0a2 100644 --- a/subiquity/client/controllers/filesystem.py +++ b/subiquity/client/controllers/filesystem.py @@ -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) diff --git a/subiquity/common/apidef.py b/subiquity/common/apidef.py index 85821a3dd..42f05fc35 100644 --- a/subiquity/common/apidef.py +++ b/subiquity/common/apidef.py @@ -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: diff --git a/subiquity/server/controllers/filesystem.py b/subiquity/server/controllers/filesystem.py index 0974d5371..22a4f81e3 100644 --- a/subiquity/server/controllers/filesystem.py +++ b/subiquity/server/controllers/filesystem.py @@ -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):