filesystem: going back to guided also does reset

Per LP: #1968160, with 2 or more disks, go to guided storage config, hit
done.  At file system summary, hit back, and choose the other disk.
While this screen does say so, one might not notice that the first disk
is still setup to be formatted.

Instead, when going back to guided storage, a reset is also done.
This commit is contained in:
Dan Bungert 2022-04-08 15:19:46 -06:00
parent 2df8d4ee86
commit 4567f009a7
2 changed files with 7 additions and 5 deletions

View File

@ -242,16 +242,17 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
def guided(self):
self.app.aio_loop.create_task(self._guided())
def reset(self):
def reset(self, refresh_view):
log.info("Resetting Filesystem model")
self.app.ui.block_input = True
self.app.aio_loop.create_task(self._reset())
self.app.aio_loop.create_task(self._reset(refresh_view))
async def _reset(self):
async def _reset(self, refresh_view):
status = await self.endpoint.reset.POST()
self.app.ui.block_input = False
self.model.load_server_data(status)
self.ui.set_body(FilesystemView(self.model, self))
if refresh_view:
self.ui.set_body(FilesystemView(self.model, self))
def cancel(self):
self.app.prev_screen()

View File

@ -542,10 +542,11 @@ class FilesystemView(BaseView):
self.show_stretchy_overlay(VolGroupStretchy(self))
def cancel(self, button=None):
self.controller.reset(refresh_view=False)
self.controller.guided()
def reset(self, button):
self.controller.reset()
self.controller.reset(refresh_view=True)
def done(self, button):
self.controller.finish()