File: msdos_swap.py

package info (click to toggle)
bootstrap-vz 0.9.11%2B20180121git-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,244 kB
  • sloc: python: 8,800; sh: 813; makefile: 16
file content (17 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from bootstrapvz.common.tools import log_check_call
from msdos import MSDOSPartition


class MSDOSSwapPartition(MSDOSPartition):
    """Represents a MS-DOS swap partition
    """

    def __init__(self, size, previous):
        """
        :param Bytes size: Size of the partition
        :param BasePartition previous: The partition that preceeds this one
        """
        super(MSDOSSwapPartition, self).__init__(size, 'swap', None, None, 'swap', previous)

    def _before_format(self, e):
        log_check_call(['mkswap', self.device_path])