a >h@s0ddlmZmZmZmZGdddeeeZdS))Plugin RedHatPlugin UbuntuPlugin PluginOptc@s\eZdZdZdZdZdZdZedddd d ed dd d d eddddgZ ddZ ddZ dS)Podmana<Podman is a daemonless container management engine, and this plugin is meant to provide diagnostic information for both the engine and the containers that podman is managing. General status information will be collected from podman commands, while detailed inspections of certain components will provide more insight into specific container problems. This detailed inspection is provided for containers, images, networks, and volumes. Per-entity inspections will be recorded in subdirs within sos_commands/podman/ for each of those types. zPodman containerspodman) container)rallFz0collect for all containers, even terminated oneszEnable collection for all containers that exist on the system regardless of their running state. This may cause a significant increase in sos archive size, especially when combined with the 'logs' option.)defaultdescZ long_desclogsz)collect stdout/stderr logs for containerszCapture 'podman logs' output for discovered containers. This may be useful or not depending on how/if the container produces stdout/stderr output. Use cautiously when also using the 'all' option.sizez!collect image sizes for podman ps)r r cCs|dddgd}|dd|D|drD|jdd d |jd d gd d|jddd}|ddkrdd|dddD}|jdd|Dddddd|jd|ddD}|jdd}|jdd}|D]}|jd |d!d"dq|D]L}|\} } d#| vr| n| } |jd | d$d%d|jd&| d'd(dq|D]} |jd)| d*d+dqT|d,r|D]} |jd-| d!d.d/qdS)0NZpodman_list_imagesZpodman_list_containers)z podman imagesz podman ps) infozimage trust showimageszimages --digestszpod psz port --allZpszps -azstats --no-stream --allversionz volume lsz system df -vcSsg|]}d|qS)zpodman ).0srr=/usr/lib/python3.9/site-packages/sos/report/plugins/podman.py Gz Podman.setup..r z podman ps -asd)priorityz/etc/cniz/etc/containersT) recursivezpodman network lsZpodman_list_networks)tagsstatusrcSsg|]}|dqSr)split)rZpnrrrrUroutputcSsg|]}d|qS)zpodman network inspect r)rnetrrrrVsZnetworksZpodman_network_inspect)subdirrcSsg|] }|dqSrr)rcrrrrZsrr )runtimeZget_all)r#zpodman inspect containersZpodman_container_inspectZnonerZpodman_image_inspectzpodman image tree z images/treeZpodman_image_treezpodman volume inspect volumesZpodman_volume_inspectr zpodman logs -t 2)r!r) Z add_cmd_tagsZadd_cmd_outputZ get_optionZadd_dir_listingZcollect_cmd_output splitlinesZget_containersZget_container_imagesZget_container_volumes)selfZsubcmdsZpnetsnetsr$rr%rZimgnameZimg_idZinspZvolZconrrrsetup2sr           z Podman.setupcCsd}|d|ddS)Nz=(?P(pass|key|secret|PASS|KEY|SECRET).*?)=(?P.*?)"z *inspect*z\g=********")Zdo_cmd_output_sub)r(Z env_regexprrrpostproc{s zPodman.postprocN) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesrZ option_listr+r,rrrrrs& IrN)Zsos.report.pluginsrrrrrrrrr s