관리-도구
편집 파일: podman.cpython-39.opt-1.pyc
a -�_g� � @ s0 d dl mZmZmZmZ G dd� deee�ZdS )� )�Plugin�RedHatPlugin�UbuntuPlugin� PluginOptc @ s\ e Zd ZdZdZdZdZdZedddd d �edddd d �edddd�gZ dd� Z dd� ZdS )�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 containers�podman)� container)r �allFz0collect for all containers, even terminated onesz�Enable 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.)�default�descZ long_desc�logsz)collect stdout/stderr logs for containersz�Capture '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 c C s� | � g d�� | �ddd�� g d�}| �dd� |D �� | �d�rR| jd d d� | jdd gdd� | jddd�}|d dkr�dd� |d �� dd � D �}| jdd� |D �ddd� dd� | jd| �d�d�D �}| jdd �}| j dd �}|D ]}| jd!|� �d"d#d� q�|D ]L}|\} } d$| v�r*| n| }| jd!|� �d%d&d� | jd'|� �d(d)d� �q|D ]}| jd*|� �d+d,d� �qb| �d-��r�|D ]} | jd.| � �d"d/d0� �q�d S )1N)Z HTTP_PROXYZHTTPS_PROXYZNO_PROXYZ ALL_PROXYZpodman_list_imagesZpodman_list_containers)z podman imagesz podman ps)�infozimage trust show�imageszimages --digestszpod psz port --allZpszps -azstats --no-stream --all�versionz volume lsc S s g | ]}d |� ��qS )zpodman � )�.0�sr r �=/usr/lib/python3.9/site-packages/sos/report/plugins/podman.py� <listcomp>M � z Podman.setup.<locals>.<listcomp>r z podman ps -as�d )�priorityz/etc/cniz/etc/containersT)� recursivezpodman network lsZpodman_list_networks)�tags�statusr c S s g | ]}|� � d �qS �r )�split)r Zpnr r r r [ r �output� c S s g | ]}d |� ��qS )zpodman network inspect r )r �netr r r r \ s ZnetworksZpodman_network_inspect)�subdirr c S s g | ]}|d �qS r r )r �cr r r r ` s r r )�runtimeZget_all)r# zpodman inspect � containersZpodman_container_inspectZnoner Zpodman_image_inspectzpodman image tree zimages/treeZpodman_image_treezpodman volume inspect �volumesZpodman_volume_inspectr zpodman logs -t �2 )r! r ) Zadd_env_varZadd_cmd_tagsZadd_cmd_outputZ get_optionZadd_dir_listingZcollect_cmd_output� splitlinesZget_containersZget_container_imagesZget_container_volumes)�selfZsubcmdsZpnets�netsr$ r r% r Zimg�nameZimg_idZinspZvolZconr r r �setup2 st � ��� ������� � �zPodman.setupc C s d}| � d|d� d S )Nz=(?P<var>(pass|key|secret|PASS|KEY|SECRET).*?)=(?P<value>.*?)"z *inspect*z\g<var>=********")Zdo_cmd_output_sub)r( Z env_regexpr r r �postproc� s �zPodman.postprocN)�__name__� __module__�__qualname__�__doc__Z short_descZplugin_nameZprofilesZpackagesr Zoption_listr+ r, r r r r r s&