Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/policies/runtimes/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/policies/runtimes/__pycache__/crio.cpython-310.pyc
o

i��d�
�@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�ContainerRuntime)�sos_get_command_output)�quotec@s:eZdZdZdZdZdd�Zddd�Zd	d
�Zdd�Z	d
S)�CrioContainerRuntimez-Runtime class to use for systems running crio�crio�crictlcCsdS)NF�)�selfrr�</usr/lib/python3/dist-packages/sos/policies/runtimes/crio.py�check_can_copysz#CrioContainerRuntime.check_can_copyFcCsvg}d|j|r	dndf}|jr9t||jjd�}|ddkr9t�|d�}|dD]}|�|d	|d
df�q)|S)z�Get a list of containers present on the system.

        :param get_all: If set, include stopped containers as well
        :type get_all: ``bool``
        z%s ps %s -o jsonz-a���chroot�statusr�output�
containers�id�metadata�name)�binary�activer�policy�sysroot�json�loads�append)r	�get_allr�_cmd�out�out_json�	containerrrr
�get_containerss�z#CrioContainerRuntime.get_containerscCs�g}|jr^td|j|jjd�}|ddkr^t�|d�}|dD]<}t|d�dkr<|dD]}|�||df�q/q!t|d	�dkrGd
}n|d	d�	d�d}|�|d|df�q!|S)
z�Get a list of images present on the system

        :returns: A list of 2-tuples containing (image_name, image_id)
        :rtype: ``list``
        z%s images -o jsonr
rrr�images�repoTagsr�repoDigestsz<none>�@z:<none>)
rrrrrrr�lenr�split)r	r"rr�image�repo_tag�
image_namerrr
�
get_images,s"
��zCrioContainerRuntime.get_imagescCs8|rt|�}n|}|�|�}|durd|j||fSdS)a�Format a command to run inside a container using the runtime

        :param container: The name or ID of the container in which to run
        :type container: ``str``

        :param cmd: The command to run inside `container`
        :type cmd: ``str``

        :param quotecmd: Whether the cmd should be quoted.
        :type quotecmd: ``bool``

        :returns: Formatted string to run `cmd` inside `container`
        :rtype: ``str``
        Nz%s %s %sr)r�get_container_by_name�run_cmd)r	r �cmd�quotecmd�
quoted_cmd�container_idrrr
�fmt_container_cmdEs

���z&CrioContainerRuntime.fmt_container_cmdN)F)
�__name__�
__module__�__qualname__�__doc__rrrr!r+r2rrrr
rs
r)r�sos.policies.runtimesr�
sos.utilitiesr�pipesrrrrrr
�<module>s
	

Spamworldpro Mini