Centralized a partition call to use the logging feature raw_parted().

This commit is contained in:
Anton Hvornum 2021-03-21 17:18:00 +01:00
parent 6a2dd8f511
commit c00e09517f
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ class Filesystem():
if self.blockdevice.keep_partitions is False:
log(f'Wiping {self.blockdevice} by using partition format {self.mode}', level=LOG_LEVELS.Debug)
if self.mode == GPT:
if sys_command(f'/usr/bin/parted -s {self.blockdevice.device} mklabel gpt',).exit_code == 0:
if self.raw_parted(f'{self.blockdevice.device} mklabel gpt').exit_code == 0:
return self
else:
raise DiskError(f'Problem setting the partition format to GPT:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel gpt')