storage: get rid of v1 guided_POST

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
(cherry picked from commit 6716523eb1bc4759c532774ee12887658c485b6c)
This commit is contained in:
Olivier Gayot 2024-04-26 21:15:24 +02:00
parent 2841cd2002
commit a143cbcdba
2 changed files with 7 additions and 6 deletions

View File

@ -26,6 +26,7 @@ from subiquity.common.types import (
GuidedStorageResponseV2, GuidedStorageResponseV2,
GuidedStorageTargetManual, GuidedStorageTargetManual,
ProbeStatus, ProbeStatus,
StorageResponse,
StorageResponseV2, StorageResponseV2,
) )
from subiquity.models.filesystem import ( from subiquity.models.filesystem import (
@ -259,7 +260,11 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
raise Exception("could not process action {}".format(action)) raise Exception("could not process action {}".format(action))
async def _guided_choice(self, choice: GuidedChoiceV2): async def _guided_choice(self, choice: GuidedChoiceV2):
coro = self.endpoint.guided.POST(choice) async def v2_guided_POST_with_v1_response() -> StorageResponse:
await self.endpoint.v2.guided.POST(choice)
return await self.endpoint.GET()
coro = v2_guided_POST_with_v1_response()
if not choice.capability.supports_manual_customization(): if not choice.capability.supports_manual_customization():
await self.app.next_screen(coro) await self.app.next_screen(coro)
return return

View File

@ -998,11 +998,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
) )
async def guided_POST(self, data: GuidedChoiceV2) -> StorageResponse: async def guided_POST(self, data: GuidedChoiceV2) -> StorageResponse:
log.debug(data) raise NotImplementedError
await self.guided(data)
if not data.capability.supports_manual_customization():
await self.configured()
return self._done_response()
async def reset_POST(self) -> StorageResponse: async def reset_POST(self) -> StorageResponse:
raise NotImplementedError raise NotImplementedError