Merge pull request #505 from mwhudson/moar-wiping

always wipe a disk when clearing its partition table
This commit is contained in:
Michael Hudson-Doyle 2019-07-12 14:45:09 +12:00 committed by GitHub
commit 89c49ddbdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -412,6 +412,7 @@ class FilesystemController(BaseController):
def reformat(self, disk):
if disk.type == "disk":
disk.preserve = False
disk.wipe = 'superblock-recursive'
self.clear(disk)
for p in list(disk.partitions()):
self.delete(p)
@ -432,6 +433,7 @@ class FilesystemController(BaseController):
if len(disk.partitions()) == 0:
if disk.type == "disk":
disk.preserve = False
disk.wipe = 'superblock-recursive'
needs_boot = self.model.needs_bootloader_partition()
log.debug('model needs a bootloader partition? {}'.format(needs_boot))