File: unformatted.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 (20 lines) | stat: -rw-r--r-- 731 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from base import BasePartition


class UnformattedPartition(BasePartition):
    """Represents an unformatted partition
    It cannot be mounted
    """

    # The states for our state machine. It can only be mapped, not mounted.
    events = [{'name': 'create', 'src': 'nonexistent', 'dst': 'unmapped'},
              {'name': 'map', 'src': 'unmapped', 'dst': 'mapped'},
              {'name': 'unmap', 'src': 'mapped', 'dst': 'unmapped'},
              ]

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