/usr/lib/python3/dist-packages/landscape/lib/__pycache__
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/disk.cpython-310.pyc (4080B)
o
c @ sn d dl mZ d dlZd dlZd dlZd dlmZ eg dZe dZ
efddZdd Zd
d Z
dd
ZdS ) )divisionN)_PY3)extext2ext3ext4reiserfsntfsmsdosdosvfatxfshpfsjfsufshfshfsplussimfsdrvfslxfsz([a-z]+)[0-9]*c c s t | D ]]}z| dd \}}}trt|d}nt|d}W n ty, Y qw |dur6||vr6qd}z||}W n tyG Y qw |j} |j| | }
|j | | }||||
|dV qdS )aZ
This is a generator that yields information about mounted filesystems.
@param mounts_file: A file with information about mounted filesystems,
such as C{/proc/mounts}.
@param statvfs_: A function to get file status information.
@param filesystems_whitelist: Optionally, a list of which filesystems to
stat.
@return: A C{dict} with C{device}, C{mount-point}, C{filesystem},
C{total-space} and C{free-space} keys. If the filesystem information
is not available, C{None} is returned. Both C{total-space} and
C{free-space} are in megabytes.
N unicode_escape
string_escapei )devicemount-point
filesystemztotal-spacez
free-space)
opensplitr codecsdecode
ValueErrorOSErrorf_bsizef_blocksf_bfree)mounts_filestatvfs_filesystems_whitelistliner mount_pointr megabytesstats
block_sizetotal_space
free_space r/ 4/usr/lib/python3/dist-packages/landscape/lib/disk.pyget_mount_info s8
r1 c C sf d}t j| } | d}t||D ]}|d d}| |d r0|r.|dt| |kr0|}q|S )a
Tries to determine to which of the mounted filesystem C{path} belongs to,
and then returns information about that filesystem or C{None} if it
couldn't be determined.
@param path: The path we want filesystem information about.
@param mounts_file: A file with information about mounted filesystems,
such as C{/proc/mounts}.
@param statvfs_: A function to get file status information.
@return: A C{dict} with C{device}, C{mount-point}, C{filesystem},
C{total-space} and C{free-space} keys. If the filesystem information
is not available, C{None} is returned. Both C{total-space} and
C{free-space} are in megabytes.
N/r )ospathrealpathr r1
startswithlen)r4 r% r&