Files
portfolio/migration-validation-framework/collectors/__pycache__/mounts.cpython-312.pyc
T

32 lines
7.3 KiB
Plaintext
Raw Normal View History

Ë
£Šòi$ãó’dZddlZddlZddlZddlmZmZmZddlm Z eje «Z Gdd«Z
dedeeeffd „Zy)
z‡
Mounts Data Collector
Collects filesystem mount information including mount points, devices,
filesystem types, and usage statistics.
éN)ÚDictÚAnyÚList)ÚPathcóØeZdZdZdZdedeeeffdZdede eeeffdZ
de eeefde eeeffd „Z dede eeefdeeeffd
Z dedeeeffd Z
dedefd Zy
)ÚMountsCollectorz+Collector for filesystem mount information.cógd¢|_y)N)z/proc/*z/sys/*z/dev/*z/run/*)Úexclude_patterns)Úselfs úcollectors/mounts.pyÚ__init__zMountsCollector.__init__s ò!
ˆÕóÚsystemÚreturncótjd|« tjd|dgddd¬«}|jdk7rt d|j «|j|j«}|j|«}|j||«}|||j|«d œS#tj$rtjd
|«t$r!}tjd |d |«d
}~wwxYw)z-Collect mount information from target system.zCollecting mounts data from ÚsshÚmountTé©Úcapture_outputÚtextÚtimeoutrzMount command failed: )ÚmountsÚusageÚ timestampzTimeout collecting mounts from zFailed to collect mounts from ú: N)ÚloggerÚinfoÚ
subprocessÚrunÚ
returncodeÚ RuntimeErrorÚstderrÚparse_mount_outputÚstdoutÚ
filter_mountsÚcollect_usage_statsÚ
get_timestampÚTimeoutExpiredÚerrorÚ Exception)r rÚresultrÚfiltered_mountsÚ usage_statsÚes r Úcollect_mountszMountsCollector.collect_mountssä Ð2°6°(Ð ä—^‘^ؘ ÐØô ˆFð× Ñ  "Ð%;¸F¿M¹M¸?Ð#KÓ×,¨V¯]©]Ó;ˆ"×Ó8ˆ×2°6¸?ÓKˆKðÓð
øô × Ü L‰LÐ:¸6¸(Ð Üò Ü L‰LÐ9¸ÀÀAÀ3Ð ûð úsšBB0Â04DÃ$DÄDÚoutputcó<g}|j«jd«D]w}|j«sŒ|j«}t|«dk\sŒ3|ddk(sŒ<|ddk(sŒE|d|d|d |d
jd «d œ}|j|«Œy|S)
zParse mount command output.ú
ééÚonéÚtyperéééz())ÚdeviceÚ
mountpointÚfstypeÚoptions)ÚstripÚsplitÚlenÚappend)r r1rÚlineÚpartsÚ
mount_infos r r$z"MountsCollector.parse_mount_output>àˆà—L‘L“N×Ó
*ˆ—::”<Øð—J‘J“LˆEÜ5‹z˜Q‹ 5¨¡8¨tÓ#3¸¸ÀFÓ8Jà# A™hØ"'¨¡(Ø# A™hØ$ Q™xŸ~™~¨dÓ
ð 
˜
ˆ
rrcó„g}|D]7}|dŠtˆfd|jD««rŒ'|j|«Œ9|S)z!Filter out unwanted mount points.r=c3ópK|]-}t«j|jd««Œ/y­w)Ú*N)rÚmatchÚrstrip)Ú.0Úpatternr=s €r ú <genexpr>z0MountsCollector.filter_mounts.<locals>.<genexpr>Ys*øèø€ÒhÀw”t˜'×-¨g¯n©n¸SÓ.A×hùsƒ36)Úanyr