AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/policies/runtimes/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

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

���b�
�@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
	

Anon7 - 2022
AnonSec Team