Mini Shell

Direktori : /lib/python3.6/site-packages/blivet/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/blivet/__pycache__/udev.cpython-36.pyc

3

�Mf��@s�ddlZddlZddlZddlZddlZddlmZddlmZddl	m	Z	ddl
Z
e
jdd�ddlm
Zej�Zejd	�ZgZd
d�Zd�dd
�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d�d3d4�Z'd5d6�Z(d�d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dMdN�Z4dOdP�Z5dQdR�Z6dSdT�Z7dUdV�Z8dWdX�Z9dYdZ�Z:d[d\�Z;d]d^�Z<d_d`�Z=dadb�Z>dcdd�Z?dedf�Z@dgdh�ZAdidj�ZBdkdl�ZCdmdn�ZDdodp�ZEdqdr�ZFdsdt�ZGdudv�ZHdwdx�ZIdydz�ZJd{d|�ZKd}d~�ZLdd��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��Zmd�d„Znd�dĄZod�dƄZpd�dȄZqd�dʄZrd�d̄Zsd�d΄ZtdS)��N�)�util)�Size)�flags�BlockDevz2.0)rZblivetcCs"t|j�}|j|d<|j|d<|S)N�SYS_NAME�SYS_PATH)�dictZ
properties�sys_nameZsys_path)�device�result�r
�/usr/lib/python3.6/udev.py�device_to_dict.s


rcCsry2|dk	rtjjt|�}n|dk	r0tjjt|�}Wn2tjk
rd}ztj|�d}WYdd}~Xn
Xt|�}|S)N)	�pyudevZDevicesZ
from_sys_path�global_udevZfrom_device_fileZDeviceNotFoundError�log�errorr)�
sysfs_path�device_noder�err
r
r�
get_device;s
r�blockcCsFtjst�g}x0tj|d�D] }t|j�st|�}|j|�qW|S)N)�	subsystem)	rZuevents�settlerZlist_devices�__is_blacklisted_blockdevr
r�append)rrr�devr
r
r�get_devicesJs
rFcCs,dddg}|rtj|dd�n
tj|�dS)zm Wait for the udev queue to settle.

        :keyword bool quiet: bypass :meth:`blivet.util.run_program`
    �udevadmrz
--timeout=300T)Z	close_fdsN)�
subprocessZcallr�run_program)�quiet�argvr
r
rrWs
r�addcCsJdd|g}|r|jd|�|r0|jd|�tjdg|�t�dS)N�triggerz--action=%sz--subsystem-match=%sz--sysname-match=%sr)rrr!r)r�action�namer#r
r
rr%fsr%cCs�|sdSddlm}|j|�}d}x�t�D]�}|jd�rTt|�|dd�kr�|}Pq*|jd�rzt|�|dd�kr�|}Pq*t|�|ks�|d|kr�|}Pq*|}|jd�s�tj	j
d|�}xt|�D]}||kr�|}Pq�Wq*W|r�|r�|dSt|�SdS)	Nr)�deviceszLABEL=�zUUID=�rz/dev/)�r(Zdevice_path_to_namer�
startswith�device_get_label�device_get_uuid�device_get_name�os�path�normpath�device_get_symlinks)Zdevspec�sysnamer(�devname�retr�spec�linkr
r
r�resolve_devspecqs4




r9cCs�ddl}g}|s|Sx�t�D]x}t|�}t|�}|rL|j||�rL|j|�q|rh|j||�rh|j|�qx*t|�D]}|rr|j||�rr|j|�qrWqW|S)z�
    :param str glob: glob to match device **names** against
    :returns: list of udev info objects matching :param:`glob`

    .. note:: This function matches device **names** ("sda"), not paths ("/dev/sda").

    rN)�fnmatchrr/�device_get_devnamerr3)Zglobr:r6rr'r1r8r
r
r�resolve_glob�sr<cs��jd�s�jd�rdStr6t�fdd�tD��r6dSd�}tjjtjj|d��r�tj|d�}|r�x,dD]$}|j	|�dkrjt
jd�|�dSqjWd
S)z0Is this a blockdev we never want for an install?Zram�fdTc3s|]}tj|��VqdS)N)�re�search)�.0�expr)�dev_namer
r�	<genexpr>�sz,__is_blacklisted_blockdev.<locals>.<genexpr>z/sys/class/block/%szdevice/model�IBM *STMF KERNEL�SCEI Flash-5�DGC LUNZrzignoring %s with model %sF)rDrErF���)r,�device_name_blacklist�anyr0r1�exists�joinr�get_sysfs_attr�findr�info)rBZdev_pathZmodelZbadr
)rBrr�s
rcCs�d|kr|d}nvd|kr�|d}t|�r0|}q�t|�dkrF|d}q�t|�rz|d}|dj�rp|d|}q~||}q�|}n|d}|S)	z> Return the best name for a device based on the udev db data. �DM_NAME�
MD_DEVNAME�linux_raid_memberrZID_PART_ENTRY_NUMBERr�prG)�device_is_md�device_get_format�device_is_partition�isdigit)�	udev_infor'ZmdnameZpartnumr
r
rr/�s 


r/cCs
|jd�S)z4 Return a device's format type as reported by udev. �
ID_FS_TYPE)�get)rWr
r
rrT�srTcCs
|jd�S)z7 Return a device's format version as reported by udev. Z
ID_FS_VERSION)rY)rWr
r
r�device_get_format_version�srZcCs
|jd�S)z� Get the UUID from the device's format as reported by udev.

        :param dict udev_info: dictionary of name-value pairs as strings
        :returns: a UUID or None
        :rtype: str or NoneType
    Z
ID_FS_UUID)rY)rWr
r
rr.�sr.cCs
|jd�S)z= Get the label from the device's format as reported by udev. ZID_FS_LABEL)rY)rWr
r
rr-�sr-cCs
|jd�S)z7 Get size for specified partition as reported by udev. ZID_PART_ENTRY_SIZE)rY)rWr
r
r�device_get_part_sizesr[cCs&tjjt|�d�}d|kp$tjj|�S)z6 Return True if the device is a device-mapper device. �dmrO)r0r1rK�device_get_sysfs_pathrJ)rNZdm_dirr
r
r�device_is_dmsr^cCs$t|�rdSt|�d}tjj|�S)z5 Return True if the device is a mdraid array device. Fz/md)rUr]r0r1rJ)rNZmd_dirr
r
rrS
srScCst|�jd�S)z. Return True if the device is a CCISS device. Zcciss)r/r,)rNr
r
r�device_is_ccisssr_cCs |jdd�jd�d}|jd�S)z- Return True if the device is a dasd device. �DEVNAMEr+�/rZdasdrG)rY�splitr,)rNr5r
r
r�device_is_dasdsrccCs�|jd�dkrdSt|�}x�tjjtjj|��}d|f}tjj|�r~tjjtj|��}tjjtj|��}|dkr~|dkr~dStjj|�}||kr�P|d}qWdS)	z- Return True if the device is a zfcp device. �DEVTYPE�diskFz	%s/driverZccwZzfcpTz
/subsystem)	rYr]r0r1�realpath�dirname�islink�basename�readlink)rNrZtopdirZdriverZ
subsystemnameZ
drivernameZnewsubsystemr
r
r�device_is_zfcp$s 
rkcCs\|stjd�dSdt|�|f}tjj|�}tjj|�sJtjd|�dSt|d�j	�j
�S)zA Return the value of the specified attribute of the zfcp device. z1device_get_zfcp_attribute() called with attr=NoneNz%s/device/%sz %s is not a valid zfcp attribute�r)r�debugr]r0r1rf�isfile�warning�open�read�strip)rN�attrZ	attributer
r
r�device_get_zfcp_attribute@s
rtcCst|�jd�dS)z+ Return the CCW bus ID of the dasd device. ra����)r]rb)rNr
r
r�device_get_dasd_bus_idPsrwcCs>|dkrdSt|�d|}tjj|�s,dSt|d�j�j�S)z0 Return the specified flag for the dasd device. Nz/device/rl)r]r0r1rnrprqrr)rN�flagr1r
r
r�device_get_dasd_flagUsrycCs|jd�dkS)z0 Return True if the device is an optical drive. ZID_CDROM�1)rY)rNr
r
r�device_is_cdromasr{cCs�tjjdt|��}|jd�dkp$|}|o�t|�p�t|�p�t|�p�t|�p�t	|�p�t
|�p�t|�o�t|�o�t
dd�t|�D��S)z� Return True if the device is a disk.

        Unfortunately, since so many things are represented as disks by
        udev/sysfs, we have to define what is a disk in terms of what is
        not a disk.
    z%s/rangerdrecss|]}t|�VqdS)N)�device_is_disk)r@�dr
r
rrCzsz!device_is_disk.<locals>.<genexpr>)r0r1rJr]rYr{rU�device_is_dm_partition�device_is_dm_lvm�device_is_dm_crypt�device_is_dm_stratisrS�device_get_md_container�all�device_get_slaves)rNZ	has_rangeZis_diskr
r
rr|hsr|cCs&tjjdt|��}|jd�dkp$|S)Nz%s/startrd�	partition)r0r1rJr]rY)rNZ	has_startr
r
rrU}srUcCst|�jd�S)z- Return True if the device is a loop device. Zloop)r/r,)rNr
r
r�device_is_loop�sr�cCs|jd|jd|jd���S)zA Get the serial number/UUID from the device as reported by udev. Z
ID_SERIAL_RAWZ	ID_SERIALZID_SERIAL_SHORT)rY)rWr
r
r�device_get_serial�sr�cCs|jd�}|r|dd�}|S)z: Return the WWID as reported by udev without '0x' prefix. ZID_WWN_WITH_EXTENSION�N)rY)rWZwwnr
r
r�device_get_wwn�s
r�cCs|jd|jd��S)z3 Get the vendor of the device as reported by udev. ZID_VENDOR_FROM_DATABASEZ	ID_VENDOR)rY)rWr
r
r�device_get_vendor�sr�cCs|jd|jd��S)z2 Get the model of the device as reported by udev. ZID_MODEL_FROM_DATABASEZID_MODEL)rY)rWr
r
r�device_get_model�sr�cCs|jdd�j�S)z5 Get the bus a device is connected to the system by. �ID_BUSr+)rY�upper)rWr
r
r�device_get_bus�sr�cCs|jdd�S)N�ID_PATHr+)rY)rNr
r
r�device_get_path�sr�cCs|jdd�j�S)z� Get an array of symbolic links for a device.

        :param info: a :class:`pyudev.Device` instance
        :returns: list of symbolic links
        :rtype: list of str
    ZDEVLINKSr+)rYrb)rNr
r
rr3�sr3cCs(xt|�D]}|jd�r
|Sq
Wt|�S)Nz/dev/disk/by-path/)r3r,r/)rNr8r
r
r�device_get_by_path�s
r�cCs|dS)Nrr
)rNr
r
rr]�sr]cCst|d�S)N�MAJOR)�int)rNr
r
r�device_get_major�sr�cCst|d�S)N�MINOR)r�)rNr
r
r�device_get_minor�sr�cCs
|jd�S)Nr`)rY)rNr
r
rr;�sr;cCsTt|�d}t�}tjj|�r(tj|�}t�}x |D]}|jtd|d��q4W|S)zI Return a list of udev device objects representing this device's slaves. z/slaves/z/dev/)r)r]�listr0r1�isdir�listdirrr)rN�
slaves_dir�namesZslavesr'r
r
rr��s

r�cCsTt|�d}t�}tjj|�r(tj|�}t�}x |D]}|jtd|d��q4W|S)zJ Return a list of udev device objects representing this device's holders. z	/holders/z/dev/)r)r]r�r0r1r�r�rr)rNZholders_dirr�Zholdersr'r
r
r�device_get_holders�s

r�cCs
|jd�S)z� Returns the RAID level of the array of which this device is a member.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the RAID level of this device's md array
        :rtype: str or NoneType
    ZMD_LEVEL)rY)rNr
r
r�device_get_md_level�s
r�cCst|d�S)aP Returns the number of active devices in this device's array.

        Active devices are devices that are not spares or failed.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the number of devices belonging to this device's md array
        :rtype: int
        :raises: KeyError, ValueError
    Z
MD_DEVICES)r�)rNr
r
r�device_get_md_devices�s
r�cCstj|d�S)z� Returns the uuid of the array of which this device is a member.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the UUID of this device's md array
        :rtype: str
        :raises: KeyError
    ZMD_UUID)r�canonicalize_UUID)rNr
r
r�device_get_md_uuidsr�cCs
|jd�S)zi
        :param dict info: dictionary of name-value pairs as strings
        :rtype: str or NoneType
    ZMD_CONTAINER)rY)rNr
r
rr�sr�cCs
|jd�S)z� Returns the name of the array of which this device is a member.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the name of this device's md array
        :rtype: str or NoneType
    rP)rY)rNr
r
r�device_get_md_names
r�cCs
|jd�S)z� Return the metadata version number.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the metadata version number of the md array
        :rtype: str or NoneType
    ZMD_METADATA)rY)rNr
r
r�device_get_md_metadata's
r�cCs&|jd�p|jd�}|r"tj|�SdS)z� Returns the uuid of a device which is a member of an md array.

        :param dict info: dictionary of name-value pairs as strings
        :returns: the uuid of this device (which is a member of an md array)
        :rtype: str or NoneType
    ZID_FS_UUID_SUBZMD_DEV_UUIDN)rYrr�)rNZmd_device_uuidr
r
r�device_get_md_device_uuid4sr�cCs|dS)NZLVM2_VG_NAMEr
)rNr
r
r�device_get_vg_nameDsr�cCs|dS)NZ
DM_VG_NAMEr
)rNr
r
r�device_get_lv_vg_nameHsr�cCs|dS)NZLVM2_VG_UUIDr
)rNr
r
r�device_get_vg_uuidLsr�cCstd|d�S)Nz%s KiBZLVM2_VG_SIZE)r)rNr
r
r�device_get_vg_sizePsr�cCstd|d�S)Nz%s KiBZLVM2_VG_FREE)r)rNr
r
r�device_get_vg_freeVsr�cCstd|d�S)Nz%s KiBZLVM2_VG_EXTENT_SIZE)r)rNr
r
r�device_get_vg_extent_size\sr�cCst|d�S)NZLVM2_VG_EXTENT_COUNT)r�)rNr
r
r�device_get_vg_extent_count`sr�cCst|d�S)NZLVM2_VG_FREE_COUNT)r�)rNr
r
r�device_get_vg_free_extentsdsr�cCst|d�S)NZ
LVM2_PV_COUNT)r�)rNr
r
r�device_get_vg_pv_counthsr�cCstd|d�S)Nz%s KiBZ
LVM2_PE_START)r)rNr
r
r�device_get_pv_pe_startlsr�cCs|dS)NZLVM2_LV_NAMEr
)rNr
r
r�device_get_lv_namepsr�cCs|dS)NZLVM2_LV_UUIDr
)rNr
r
r�device_get_lv_uuidtsr�cCstd|d�S)Nz%s KiBZLVM2_LV_SIZE)r)rNr
r
r�device_get_lv_sizexsr�cCs|dS)NZLVM2_LV_ATTRr
)rNr
r
r�device_get_lv_attr|sr�cCs|dS)NZLVM2_SEGTYPEr
)rNr
r
r�device_get_lv_type�sr�cCs:|jd�}|dkrdStjj|�}|s*dS|j�|j�kS)zD Return True if the device matches a given device-mapper subsystem. rONF)rY�blockdevr\Zget_subsystem_from_name�lower)rNrr'Z
_subsystemr
r
r�device_dm_subsystem_match�s
r�cCs
t|d�S)z5 Return True if the device is an LVM logical volume. Zlvm)r�)rNr
r
rr�srcCs
t|d�S)z8 Return True if the device is a mapped dm-crypt device. �crypt)r�)rNr
r
rr��sr�cCsPt|d�}y|jdd�jd�dj�}Wntk
r@d}YnX|oN|jd�S)z4 Return True if the device is a mapped LUKS device. r��DM_UUIDr+�-rZluks)r�rYrbr��
IndexErrorr,)rN�is_crypt�_typer
r
r�device_is_dm_luks�s

r�cCsTt|d�}|sdSy|jdd�jd�dj�}Wntk
rHd}YnX|jd�S)z9 Return True if the device is a mapped integrity device. r�Fr�r+r�rZ	integrity)r�rYrbr�r�r,)rNr�r�r
r
r�device_is_dm_integrity�s

r�cCs
t|d�S)z5 Return True if the device is a dmraid array device. Zdmraid)r�)rNr
r
r�device_is_dm_raid�sr�cCs
t|d�S)z2 Return True if the device is a multipath device. Zmpath)r�)rNr
r
r�device_is_dm_mpath�sr�cCs
t|d�S)z6 Return True if the device is an anaconda disk image. Zanaconda)r�)rNr
r
r�device_is_dm_anaconda�sr�cCst|�ot|�jd�S)z1 Return True if the device is a livecd OS image. Zlive)r^r/r,)rNr
r
r�device_is_dm_livecd�sr�cCs
t|d�S)z< Return True if the device is a Stratis pool or filesystem. Zstratis)r�)rNr
r
rr��sr�cCsPddlm}ddlm}d|krL|d|jks<|d|jkrL|ddkrLdSdS)Nr)�DMRaidMember)�MDRaidMemberrXrQTF)Zformats.dmraidr�Zformats.mdraidr�Z_udev_types)rNr�r�r
r
r�device_is_biosraid_member�sr�c
Cs�t|�pt|�sdSd}|jd�}t|�}d|}|r||jd�\}}x�t�D]*}|jd�|krL|jd�|krLt|�}PqLWnrt|�r�tjj	|�r�tj
|�}t|�dkr�t|dj
d	d
��}n2tjjtjj|�j
d	d
��}	|dj|	�r�t|	�}|S)z; Return the (friendly) name of the given partition's disk. NZID_PART_ENTRY_DISKz	%s/slaves�:r�r�rr�!rar)rUr~rYr]rbrr/r0r1r�r��lenr9�replacerirgr,)
rNreZ
majorminorrr��major�minorr�parentsZ_diskr
r
r�device_get_partition_disk�s*

r�cCs$t|�o"|jdd�jd�djd�S)Nr�r+r�r�part)r^rYrbr,)rNr
r
rr~�sr~cCst|�st|�rdS|jd�S)z5 Return the type of disklabel on the device or None. NZID_PART_TABLE_TYPE)rUr~rY)rNr
r
r�device_get_disklabel_typesr�cCs
|jd�S)NZID_PART_TABLE_UUID)rY)rNr
r
r�device_get_disklabel_uuidsr�cCs
|jd�S)NZID_PART_ENTRY_UUID)rY)rNr
r
r�device_get_partition_uuidsr�cCs`yFt|�jd�}|ddkrDt|�dkrD|ddkrD|ddkrDd	SWntk
rZYnXd
S)Nr�r��scsir)r�ipr��iscsiTF)r�rbr��KeyError)rN�path_componentsr
r
r�device_is_sw_iscsisr�cCs`yFt|�jd�}|ddkrDt|�dkrD|ddkrD|ddkrDd	SWntk
rZYnXd
S)Nr�r�r��r�r��r�TF)r�rbr�r�)rNr�r
r
r�device_is_partoff_iscsi*sr�cCst|�pt|�S)N)r�r�)rNr
r
r�device_is_iscsi8sr�cCs8d}t|�rd}t|�jd�}dj||t|�d��S)Nrur*r�r�)r�r�rbrKr�)rNZ
name_fieldr�r
r
r�device_get_iscsi_name<s
r�cCs:d}t|�jd�}tt|��jd�}|dkr6||}|S)Nrr��lun)r�rbr��reversed�index)rNr�r��idxr
r
r�device_get_iscsi_lunGs
r�cCs:d}t|�rd}t|�jd�}dj||jd�dd��S)Nrrur�r�rG)r�r�rbrK)rN�
address_fieldr�r
r
r�device_get_iscsi_addressQs
r�cCs0d}t|�rd}t|�jd�}||jd�dS)Nrrur�r�rG)r�r�rb)rNr�r�r
r
r�device_get_iscsi_port]s
r�cCs6d}tjdt|��}|r&|j�d}ntjd|�|S)Nz/.*/(session\d+)rz1device_get_iscsi_session: session not found in %s)r>�matchr]�groupsrr)rN�sessionr�r
r
r�device_get_iscsi_sessionhsr�cCs(d}t|�}|r$td|�j�j�}|S)Nz%/sys/class/iscsi_session/%s/ifacename)r�rprqrr)rN�ifacer�r
r
r�device_get_iscsi_nicusr�cCs�d}t|�r�tjdt|��j�d}|r�d|}tj|tj�r�t|d�j	�j
�}|jddd�}tj
d||�|jd	�jd
�j�dkr�d}|dkr�t|�}|r�td|d�j	�j
�}|jddd�}tj
d
|�|S)Nz.*/(host\d+)rz&/sys/class/iscsi_host/%s/initiatorname�rbzutf-8r�)�errorsz/found offload iscsi initiatorname %s in file %s�(�)Znullz)/sys/class/iscsi_session/%s/initiatornamezfound iscsi initiatorname %s)r�r>r�r]r�r0�access�R_OKrprqrr�decoderrm�lstrip�rstripr�r�)rNZinitiator_name�hostZinitiator_fileZ	initiatorr�r
r
r�device_get_iscsi_initiator~s(r�cCsRtjd�}|jt|��}|rN|j�\}}tjd||ftj�rNd|krN||fSdS)Nz(.*)/(host\d+)z
%s/%s/fc_host�net)NN)r>�compiler�r]r�r0r��X_OK)rNZre_pci_hostr��	sysfs_pcir�r
r
r�_detect_broadcom_fcoe�s
r�cCs||jd�dkrdS|jdd�}|jd�}|jd�rNt|�dkrN|d	d
krNdS|jd�rhd
t|�krhdSt|�dkrxdSdS)Nr�r�Fr�r+r�zpci-ethr�r��fcTzfc-�fcoe)NN)rYrbr,r�r]r�)rNr1r�r
r
r�device_is_fcoe�s
r�c	Cs�|jdd�}|jd�}t|�}|jd�rHt|�dkrH|ddkrH|dS|jd	�rrd
|krr|jd�djd
�dSt|�\}}||fdkr�|jd�dd�\}}|dkr�tjd|�tj	d�j
|�}|r�|j�djd
�dSn|SdS)Nr�r+r�zpci-ethr�r�r�rzfc-r�rar*�.rr)r�r�z*unexpected sysfs_path of bnx2fc device: %sz.*/net/([^/]*))NN)rYrbr]r,r�r�rror>r�r�r�)	rNr1r�rr�r�r�r�r�r
r
r�device_get_fcoe_nic�s"
r�cCs�|jdd�}|jd�}|jd�r@t|�dkr@|ddkr@|dS|jd	�r^d
t|�kr^|dSt|�r�t|�dkr�|ddkr�|dSdS)Nr�r+r�zpci-ethr�r�r�ruzfc-r�r)rYrbr,r�r]r�)rNr1r�r
r
r�device_get_fcoe_identifier�s
r�cCsB|jd�dkrdStjtjj�s$dS|jdd�}tj|�}|dk	S)NrdreFr`r+)rYr�Zis_plugin_availableZPluginZNVDIMMZnvdimm_namespace_get_devname)rNr5Zninfor
r
r�device_is_nvdimm_namespace�s
rcCs4t|�}tj|d�}|s$|j�r(dStt|��S)N�hiddenF)r]rrL�	isnumeric�boolr�)rNrrr
r
r�device_is_hiddens
rcCs@t|�sdSy|jdd�jd�ddkStk
r:dSXdS)NFr�r+r�r�Zfs)r�rYrbr�)rNr
r
r�device_is_stratis_filesystemsrcCsHt|�pt|�sdSy|jdd�jd�ddkStk
rBdSXdS)NFrOr+r�r�Zprivate)r�r�rYrbr�)rNr
r
r�device_is_stratis_privatesrcCst|�rt|�SdS)NF)r�r)rNr
r
r�device_is_privatesr)NN)r)F)Nr$N)F)N)N)ur0r>r Zloggingrr+r�sizerrZgiZrequire_versionZ
gi.repositoryrr�ZContextrZ	getLoggerrrHrrrrr%r9r<rr/rTrZr.r-r[r^rSr_rcrkrtrwryr{r|rUr�r�r�r�r�r�r�r3r�r]r�r�r;r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
r
r
r�<module>s�





$











	/