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

19 lines
475 B
Python
Raw Normal View History

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