bootstrap-vz/bootstrapvz/base/fs/partitions/gpt_swap.py

18 lines
482 B
Python
Raw Normal View History

from bootstrapvz.common.tools import log_check_call
from gpt import GPTPartition
class GPTSwapPartition(GPTPartition):
2014-03-23 16:04:03 +01:00
"""Represents a GPT swap partition
"""
def __init__(self, size, previous):
2014-03-23 16:04:03 +01:00
"""
:param Bytes size: Size of the partition
:param BasePartition previous: The partition that preceeds this one
2014-03-23 16:04:03 +01:00
"""
2014-02-23 17:52:05 +01:00
super(GPTSwapPartition, self).__init__(size, 'swap', None, 'swap', previous)
def _before_format(self, e):
log_check_call(['mkswap', self.device_path])