diff --git a/subiquity/models/filesystem.py b/subiquity/models/filesystem.py index 381deec0..b94879c3 100644 --- a/subiquity/models/filesystem.py +++ b/subiquity/models/filesystem.py @@ -1095,9 +1095,6 @@ class ZPool: def mount(self): return self.mountpoint - async def pre_shutdown(self, command_runner): - await command_runner.run(['zpool', 'export', self.pool]) - @fsobj("zfs") class ZFS: diff --git a/subiquity/server/controllers/filesystem.py b/subiquity/server/controllers/filesystem.py index ea588639..935b3fad 100644 --- a/subiquity/server/controllers/filesystem.py +++ b/subiquity/server/controllers/filesystem.py @@ -1329,5 +1329,5 @@ class FilesystemController(SubiquityController, FilesystemManipulator): if not self.reset_partition_only: await self.app.command_runner.run( ['umount', '--recursive', '/target']) - for pool in self.model._all(type='zpool'): - await pool.pre_shutdown(self.app.command_runner) + if len(self.model._all(type='zpool')) > 0: + await self.app.command_runner.run(['zpool', 'export', '-a'])