Mini Shell
3
�Mf% � @ s� d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z ddl
Z
e
jd�Zd d
l
mZ d dlmZmZ G dd
� d
e�ZG dd� de�ZdS )� )�crypto)�log_method_call)�Size)�availability)�DeviceError� NZblivet� )�
StorageDevice)�
DMCryptDevice�DMIntegrityDevicec s� e Zd ZdZdZdZdgZejgZ d(dd �Z
ed
d� �Zedd
� �Z
dd� Z� fdd�Zeee�Zedd� �Zdd� Zdd� Zedd� �Zedd� �Zdd� Zdd� Zd)d d!�Zd"d#� Zd$d%� Z� fd&d'�Z� ZS )*�
LUKSDevicez A mapped LUKS device. z
luks/dm-cryptTZ
cryptsetupNF� c
C s t j| |||||d|d� dS )a�
:param name: the device name (generally a device node's basename)
:type name: str
:keyword exists: does this device exist?
:type exists: bool
:keyword size: the device's size
:type size: :class:`~.size.Size`
:keyword parents: a list of parent devices
:type parents: list of :class:`StorageDevice`
:keyword fmt: this device's formatting
:type fmt: :class:`~.formats.DeviceFormat` or a subclass of it
:keyword sysfs_path: sysfs device path
:type sysfs_path: str
:keyword uuid: the device UUID
:type uuid: str
N)�fmt�size�parents�
sysfs_path�uuid�exists)r
�__init__)�self�namer r r r r r � r �/usr/lib/python3.6/luks.pyr - s zLUKSDevice.__init__c C s | j S )N)�slave)r r r r �
raw_deviceC s zLUKSDevice.raw_devicec C s | j r| jd jd S | jd S )Nr )�_has_integrityr )r r r r r G s zLUKSDevice.slavec C s<