Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/podman.cpython-36.opt-1.pyc

3

�f��@s0ddlmZmZmZmZGdd�deee�ZdS)�)�Plugin�RedHatPlugin�UbuntuPlugin�	PluginOptc@s\eZdZdZdZdZdZdZeddddd	�ed
dddd	�ed
ddd�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�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
rc
Cs�|jddddg�|jddd��dd	d
ddd
ddddg
}|jdd�|D��|jd�rf|jddd�|jddg�|jddd�}|ddkr�dd�|d j�d!d�D�}|jd"d�|D�d#d$d%�d&d�|jd'|jd(�d)�D�}|jd'd*�}|jd'd*�}x"|D]}|jd+|d,d-d%��qWx<|D]4}|\}	}
d.|	k�r@|	n|
}|jd+|d	d/d%��q&Wx"|D]}|jd0|d1d2d%��qdW|jd3��r�x"|D]}
|jd4|
d,d5d6��q�WdS)7NZ
HTTP_PROXYZHTTPS_PROXYZNO_PROXYZ	ALL_PROXYZpodman_list_imagesZpodman_list_containers)z
podman imagesz	podman ps�info�imageszimages --digestszpod psz
port --allZpszps -azstats --no-stream --all�versionz	volume lscSsg|]}d|�qS)z	podman %s�)�.0�srr�/usr/lib/python3.6/podman.py�
<listcomp>Lsz Podman.setup.<locals>.<listcomp>r
z
podman ps -as�d)�priorityzls -alhR /etc/cnizls -alhR /etc/containerszpodman network lsZpodman_list_networks)�tagsZstatusrcSsg|]}|j�d�qS)r)�split)rZpnrrrrZs�output�cSsg|]}d|�qS)zpodman network inspect %sr)rZnetrrrr\sZnetworksZpodman_network_inspect)�subdirrcSsg|]}|d�qS)rr)r�crrrr`srr	)�runtimeZget_all)rzpodman inspect %s�
containersZpodman_container_inspectZnoneZpodman_image_inspectzpodman volume inspect %s�volumesZpodman_volume_inspectrzpodman logs -t %s�2)rr)	Zadd_env_varZadd_cmd_tagsZadd_cmd_outputZ
get_optionZcollect_cmd_output�
splitlinesZget_containersZget_container_imagesZget_container_volumes)�selfZsubcmdsZpnetsZnetsrrr rZimg�nameZimg_idZinspZvolZconrrr�setup2sh









zPodman.setupcCsd}|jd|d�dS)Nz=(?P<var>(pass|key|secret|PASS|KEY|SECRET).*?)=(?P<value>.*?)"z	*inspect*z\g<var>=********")Zdo_cmd_output_sub)r#Z
env_regexprrr�postproc{szPodman.postprocN)r)r)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesrZoption_listr%r&rrrrrs

IrN)Zsos.report.pluginsrrrrrrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists