/usr/lib/python3/dist-packages/landscape/lib/__pycache__
NameSizeModeActions
amp.cpython-310.pyc217830644editdlrm
backoff.cpython-310.pyc21370644editdlrm
base64.cpython-310.pyc3330644editdlrm
bootstrap.cpython-310.pyc22770644editdlrm
bpickle.cpython-310.pyc66580644editdlrm
cli.cpython-310.pyc5810644editdlrm
cloud.cpython-310.pyc18610644editdlrm
compat.cpython-310.pyc6060644editdlrm
config.cpython-310.pyc102180644editdlrm
disk.cpython-310.pyc40800644editdlrm
encoding.cpython-310.pyc7590644editdlrm
fd.cpython-310.pyc9510644editdlrm
fetch.cpython-310.pyc72350644editdlrm
format.cpython-310.pyc8920644editdlrm
fs.cpython-310.pyc35930644editdlrm
gpg.cpython-310.pyc21700644editdlrm
hashlib.cpython-310.pyc4080644editdlrm
jiffies.cpython-310.pyc13520644editdlrm
juju.cpython-310.pyc8070644editdlrm
lock.cpython-310.pyc10650644editdlrm
log.cpython-310.pyc6710644editdlrm
logging.cpython-310.pyc23660644editdlrm
message.cpython-310.pyc21270644editdlrm
monitor.cpython-310.pyc72000644editdlrm
network.cpython-310.pyc90150644editdlrm
os_release.cpython-310.pyc12490644editdlrm
persist.cpython-310.pyc177870644editdlrm
plugin.cpython-310.pyc25650644editdlrm
process.cpython-310.pyc43830644editdlrm
reactor.cpython-310.pyc101080644editdlrm
schema.cpython-310.pyc71550644editdlrm
scriptcontent.cpython-310.pyc6740644editdlrm
sequenceranges.cpython-310.pyc49200644editdlrm
store.cpython-310.pyc12200644editdlrm
sysstats.cpython-310.pyc77650644editdlrm
tag.cpython-310.pyc8790644editdlrm
testing.cpython-310.pyc261940644editdlrm
timestamp.cpython-310.pyc4360644editdlrm
twisted_util.cpython-310.pyc47360644editdlrm
user.cpython-310.pyc9080644editdlrm
versioning.cpython-310.pyc16480644editdlrm
vm_info.cpython-310.pyc28240644editdlrm
warning.cpython-310.pyc6150644editdlrm
__init__.cpython-310.pyc3520644editdlrm
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/disk.cpython-310.pyc (4080B)
o c@snddlmZddlZddlZddlZddlmZegdZe dZ efddZ dd Z d d Z d d ZdS))divisionN)_PY3)extext2ext3ext4reiserfsntfsmsdosdosvfatxfshpfsjfsufshfshfsplussimfsdrvfslxfsz([a-z]+)[0-9]*c cst|D]]}z|dd\}}}trt|d}nt|d}Wn ty,Yqw|dur6||vr6qd}z||}Wn tyGYqw|j} |j| |} |j | |} |||| | dVqdS)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. Nunicode_escape string_escapei)device mount-point filesystemz total-spacez free-space) opensplitrcodecsdecode ValueErrorOSErrorf_bsizef_blocksf_bfree) mounts_filestatvfs_filesystems_whitelistliner mount_pointr megabytesstats block_size total_space free_spacer/4/usr/lib/python3/dist-packages/landscape/lib/disk.pyget_mount_infos8      r1cCsfd}tj|}|d}t||D]}|dd}||dr0|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)ospathrealpathrr1 startswithlen)r4r%r& candidate path_segmentsinfomount_segmentsr/r/r0get_filesystem_for_path<s  r<cCstj|dr dSt|}|sdSd}zt|d }|}Wdn1s*wYWn ty:YdSw|dkrCdSdS)z This function returns whether a given device is removable or not by looking at the corresponding /sys/block//removable file @param device: The filesystem path to the device, e.g. /dev/sda1 mmcblkTFNr1) r3r4basenamer6_get_device_removable_file_pathrreadlineIOErrorstrip)rr4contentsfr/r/r0is_device_removableXs"     rGcCs\tj|r t|}|ddd\}t|}|sdS|d}tjd|d}|S)a5 Get a device's "removable" file path. This function figures out the C{/sys/block//removable} path associated with the given device. The file at that path contains either a "0" if the device is not removable, or a "1" if it is. @param device: File system path of the device. r2Nrz /sys/block/ removable) r3r4islinkreadlinkrEXTRACT_DEVICEmatchgroupsjoin)r device_namematchedremovable_filer/r/r0rAus   rA) __future__rr3rerlandscape.lib.compatr frozensetSTABLE_FILESYSTEMScompilerLr1r<rGrAr/r/r/r0s    )