Mini Shell
3
{)c_� � @ sd d dl Z d dlZd dlZd dlZd dlZejdd� d dlmZ ddl m
Z
ddlmZ ddlm
Z
mZmZmZmZ dd lmZmZ dd
lmZmZmZ ddlmZmZ ddlmZ dd
lmZ ddlm Z ddl!m"Z" ddlm#Z# ddl$m%Z% ddl&m'Z'm(Z( ddl)m*Z* ddl+m,Z, d dl-Z-e-j.d�Z/eefZ0ej1e*�G dd� de2��Z3G dd� de3e%e"�Z4dS )� N�BlockDevz2.0)r � )�
ActionList)� callbacks)�DeviceError�DeviceTreeError�StorageError�DuplicateUUIDError�InvalidMultideviceSelection)�ActionDestroyDevice�ActionDestroyFormat)�BTRFSDevice�NoDevice�PartitionDevice)�LVMLogicalVolumeDevice�LVMVolumeGroupDevice)�Tags)�formats)�lvm)�EventHandlerMixin)�util)�PopulatorMixin)�log_method_call�log_method_return)�SynchronizedMeta)�lvs_infoZblivetc @ sl e Zd ZdZdMdd�ZdNdd�Zdd� Zed d
� �Zedd� �Z dOdd�Z
dPdd�ZdQdd�Zedd� �Z
dd� Zdd� Zdd� Zdd� ZdRdd �Zd!d"� Zd#d$� Zd%d&� ZdSd'd(�ZdTd)d*�ZdUd+d,�ZdVd-d.�ZdWd/d0�ZdXd1d2�ZdYd3d4�ZdZd5d6�Zed7d8� �Zed9d:� �Zed;d<� �Z ed=d>� �Z!ed?d@� �Z"dAdB� Z#dCdD� Z$dEdF� Z%dGdH� Z&dIdJ� Z'dKdL� Z(dS )[�DeviceTreeBasea� A quasi-tree that represents the devices in the system.
The tree contains a list of :class:`~.devices.StorageDevice` instances,
which does not necessarily reflect the actual state of the system's
devices. :class:`~.deviceaction.DeviceAction` is used to perform
modifications to the tree, except when initially populating the tree.
:class:`~.deviceaction.DeviceAction` instances are registered, possibly
causing the addition or removal of :class:`~.devices.StorageDevice`
instances to/from the tree. A :class:`~.deviceaction.DeviceAction`
is reversible up to the time its 'execute' method is called.
Only one action of any given type/object pair should exist for
any given device at any given time.
:class:`~.deviceaction.DeviceAction` instances can only be registered
for leaf devices, except for resize actions.
Nc C s | j ||� dS )z�
:keyword ignored_disks: ignored disks
:type ignored_disks: list
:keyword exclusive_disks: exclusive didks
:type exclusive_disks: list
N)�reset)�self�
ignored_disks�exclusive_disks� r! � /usr/lib/python3.6/devicetree.py�__init__K s zDeviceTreeBase.__init__c C sD g | _ t| j| jd�| _g | _tj� |p,g | _|p6g | _ i | _
dS )z� Reset the instance to its initial state.
:keyword ignored_disks: ignored disks
:type ignored_disks: list
:keyword exclusive_disks: exclusive didks
:type exclusive_disks: list
)ZaddfuncZ
removefuncN)�_devicesr �_register_action�_cancel_action�_actions�_hiddenr Zlvm_devices_resetr r �edd_dict)r r r r! r! r"