![]() 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__/ |
o i��d� � @ s@ d dl Z d dlmZ d dlmZ d dlmZ G dd� de�ZdS )� N)�ContainerRuntime)�sos_get_command_output)�quotec @ s: e Zd ZdZdZdZdd� Zddd�Zd d � Zdd� Z d S )�CrioContainerRuntimez-Runtime class to use for systems running crio�crio�crictlc C s dS )NF� )�selfr r �</usr/lib/python3/dist-packages/sos/policies/runtimes/crio.py�check_can_copy s z#CrioContainerRuntime.check_can_copyFc C sv g }d| j |r dndf }| jr9t|| jjd�}|d dkr9t�|d �}|d D ]}|�|d |d d f� 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� containerr r r �get_containers s �z#CrioContainerRuntime.get_containersc C s� g }| j r^td| j | jjd�}|d dkr^t�|d �}|d D ]<}t|d �dkr<|d D ]}|�||d f� q/q!t|d �dkrGd }n|d d � d�d }|�|d |d f� 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 r r r �images�repoTagsr �repoDigestsz<none>�@z:<none>) r r r r r r r �lenr �split)r r"