Mini Shell
3
{)ce � @ s| d dl Z e jdd� d dlmZ d dlZddlmZ ddlmZ ddl m
Z dd lmZ dd
l
mZ ddlmZ ddlmZ dd
lmZ ddlmZ d dlZejd�ZddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! G dd� de�Z"G dd� de"�Z#G dd� de!e�Z$G dd� de!�Z%G dd� de"e�Z&G d d!� d!e"e�Z'G d"d#� d#e"�Z(G d$d%� d%e"�Z)G d&d'� d'e"�Z*dS )(� N�BlockDevz2.0)r � )�errors)�util)�disk)�flags)�log_method_call)�udev)�Size)�availability)�fcoeZblivet� )�Tags)�
StorageDevice)�ContainerDevice)�NetworkStorageDevice)�DMDevicec
@ s� e Zd ZdZdZdZdZddd�Zdd � Zd
d� Z e
dd
� �Ze
dd� �Zdd� Z
e
dd� �Ze
dd� �Ze
dd� �Ze
dd� �Ze
dd� �ZdS )�
DiskDevicez� A local/generic disk.
This is not the only kind of device that is treated as a disk. More
useful than checking isinstance(device, DiskDevice) is checking
device.is_disk.
r TN� c C s� t j| ||||||||||
| ||
d� |p,d| _yttj| jd��dk}W n tk
rb d}Y nX | jj t
j� |r�| jj t
j� |dkr�| jj t
j
� | jr�| jj t
j� dS )a�
:param name: the device name (generally a device node's basename)
:type name: str
: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 uuid: universally unique identifier (device -- not fs)
:type uuid: str
:keyword sysfs_path: sysfs device path
:type sysfs_path: str
:keyword removable: whether or not this is a removable device
:type removable: bool
:keyword serial: the ID_SERIAL_RAW, ID_SERIAL or ID_SERIAL_SHORT for
this device (which one is available)
:type serial: str
:keyword vendor: the manufacturer of this Device
:type vendor: str
:keyword model: manufacturer's device model string
:type model: str
:keyword bus: the interconnect this device uses
:type bus: str
:keyword str wwn: the disk's WWN
DiskDevices always exist.
)�fmt�size�major�minor�exists�
sysfs_path�parents�serial�model�vendor�bus�uuidNzqueue/rotationalr F�usb)r �__init__�wwn�intr Zget_sysfs_attrr � TypeError�tags�addr �local�ssdr! � removable)�self�namer r r r r r r r r r r# r r r) � r- �/usr/lib/python3.6/disk.pyr"