Sindbad~EG File Manager
3
�f� � @ s0 d dl mZmZmZmZ G dd� deee�ZdS )� )�Plugin�RedHatPlugin�UbuntuPlugin� PluginOptc @ s\ e Zd ZdZdZdZdZdZeddddd �ed
dddd �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
r c
C s� | j ddddg� | jddd�� dd d
ddd
ddddg
}| jdd� |D �� | jd�rf| jddd� | jddg� | jddd�}|d dkr�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%� �qW x<|D ]4}|\} }
d.| k�r@| n|
}| jd+| d d/d%� �q&W x"|D ]}| jd0| d1d2d%� �qdW | jd3��r�x"|D ]}
| jd4|
d,d5d6� �q�W d S )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 lsc S s g | ]}d | �qS )z podman %s� )�.0�sr r �/usr/lib/python3.6/podman.py�
<listcomp>L s z Podman.setup.<locals>.<listcomp>r
z
podman ps -as�d )�priorityzls -alhR /etc/cnizls -alhR /etc/containerszpodman network lsZpodman_list_networks)�tagsZstatusr c S s g | ]}|j � d �qS )r )�split)r Zpnr r r r Z s �output� c S s g | ]}d | �qS )zpodman network inspect %sr )r Znetr 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 %s�
containersZpodman_container_inspectZnoneZpodman_image_inspectzpodman volume inspect %s�volumesZpodman_volume_inspectr zpodman logs -t %s�2 )r r ) Zadd_env_varZadd_cmd_tagsZadd_cmd_outputZ
get_optionZcollect_cmd_output�
splitlinesZget_containersZget_container_imagesZget_container_volumes)�selfZsubcmdsZpnetsZnetsr r r r Zimg�nameZimg_idZinspZvolZconr r r �setup2 sh
zPodman.setupc C s d}| j 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)r )r )�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesr Zoption_listr% r&