Ejemplo n.º 1
0
 def __init__(self, parent_dev, type, number):
     Device.__init__(
         self, disk_utils.get_partition_path(parent_dev.system_path,
                                             number))
     self.number = number
     self.parent_device = parent_dev
     self.type = type
Ejemplo n.º 2
0
 def __init__(self, path, disk_type: DiskType, serial_number, block_size):
     Device.__init__(self, path)
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partition_table = None
     self.partitions = []  # TODO: Create partitions discover method
Ejemplo n.º 3
0
 def __init__(self, parent_dev, type, number, begin: Size, end: Size):
     Device.__init__(self, disk_utils.get_partition_path(parent_dev.path, number))
     self.number = number
     self.parent_device = parent_dev
     self.type = type
     self.begin = begin
     self.end = end
Ejemplo n.º 4
0
 def __init__(
     self,
     path,
     disk_type: DiskType,
     serial_number,
     block_size,
 ):
     Device.__init__(self, path)
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partitions = []
Ejemplo n.º 5
0
 def __init__(self, core_device: str, cache_id: int):
     self.core_device = Device(core_device)
     self.path = None
     core_info = self.__get_core_info()
     # "-" is special case for cores in core pool
     if core_info["core_id"] != "-":
         self.core_id = int(core_info["core_id"])
     if core_info["exp_obj"] != "-":
         Device.__init__(self, core_info["exp_obj"])
     self.cache_id = cache_id
     self.partitions = []
     self.block_size = None
Ejemplo n.º 6
0
 def __init__(
     self,
     path,
     disk_type: DiskType,
     serial_number,
     block_size,
 ):
     Device.__init__(self, path)
     path = fs_utils.readlink(path)
     self.device_name = path.split('/')[-1]
     self.serial_number = serial_number
     self.block_size = Unit(block_size)
     self.disk_type = disk_type
     self.partitions = []
Ejemplo n.º 7
0
    def __init__(
        self,
        path,
        disk_type: DiskType,
        serial_number,
        block_size,
        part_table_type: PartitionTable = PartitionTable.gpt,
    ):
        Device.__init__(self, path)
        self.serial_number = serial_number
        self.block_size = Unit(block_size)
        self.disk_type = disk_type
        self.partitions = []
        self.umount_all_partitions()
        if not disk_utils.create_partition_table(self, part_table_type):
            raise Exception("Failed to create partition")

        self.partition_table = part_table_type
Ejemplo n.º 8
0
 def __init__(
     self,
     path: str,
     level: Level,
     uuid: str,
     container_uuid: str = None,
     container_path: str = None,
     metadata: MetadataVariant = MetadataVariant.Imsm,
     array_devices: [Device] = [],
     volume_devices: [Device] = [],
 ):
     Device.__init__(self, path)
     self.device_name = path.split('/')[-1]
     self.level = level
     self.uuid = uuid
     self.container_uuid = container_uuid
     self.container_path = container_path
     self.metadata = metadata
     self.array_devices = array_devices if array_devices else volume_devices.copy(
     )
     self.volume_devices = volume_devices
     self.partitions = []
     self.__block_size = None