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
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
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
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 = []
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
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 = []
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
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