Fix msdos partition/filesystem types definition

This closes #142.
This commit is contained in:
Tiago Ilieve 2015-04-25 21:07:48 -03:00
parent 22760c76db
commit 3131558691

View file

@ -97,9 +97,18 @@ class BasePartition(AbstractPartition):
"""Creates the partition """Creates the partition
""" """
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
# The create command is failry simple, start and end are just Bytes objects coerced into strings # The create command is fairly simple:
create_command = ('mkpart primary {start} {end}' # - fs_type is the partition filesystem, as defined by parted:
.format(start=str(self.get_start() + self.pad_start), # fs-type can be one of "fat16", "fat32", "ext2", "HFS", "linux-swap",
# "NTFS", "reiserfs", or "ufs".
# - start and end are just Bytes objects coerced into strings
if self.filesystem == 'swap':
fs_type = 'linux-swap'
else:
fs_type = 'ext2'
create_command = ('mkpart primary {fs_type} {start} {end}'
.format(fs_type=fs_type,
start=str(self.get_start() + self.pad_start),
end=str(self.get_end() - self.pad_end))) end=str(self.get_end() - self.pad_end)))
# Create the partition # Create the partition
log_check_call(['parted', '--script', '--align', 'none', e.volume.device_path, log_check_call(['parted', '--script', '--align', 'none', e.volume.device_path,