bootstrap-vz/base/fs/partitions/gpt.py

19 lines
692 B
Python
Raw Normal View History

from common.tools import log_check_call
from base import BasePartition
class GPTPartition(BasePartition):
2014-02-23 17:52:05 +01:00
def __init__(self, size, filesystem, format_command, name, previous):
self.name = name
2014-02-23 17:52:05 +01:00
super(GPTPartition, self).__init__(size, filesystem, format_command, previous)
def _before_create(self, e):
2014-01-19 01:02:29 +01:00
super(GPTPartition, self)._before_create(e)
2014-01-18 23:10:16 +01:00
# partition name only works for gpt, for msdos that becomes the part-type (primary, extended, logical)
name_command = ('name {idx} {name}'
.format(idx=self.get_index(),
name=self.name))
log_check_call(['parted', '--script', e.volume.device_path,
2014-01-18 23:10:16 +01:00
'--', name_command])