+
    im  c                   sH    ^ RI t ^ RIHt ^ RIHt ^ RIHt  ! R R]4      tR# )i    N)quote)ContainerRuntime)sos_get_command_outputc                   sH   a  ] tR t^t o RtRtRtR tR
R ltR t	R t
RtV tR	# )CrioContainerRuntimez-Runtime class to use for systems running crioZcrioZcrictlc                s    R # F )selfs   &?/usr/lib/python3.14/site-packages/sos/policies/runtimes/crio.pycheck_can_copyZ#CrioContainerRuntime.check_can_copy   s        c                sl   . pV P                    RV'       d   RMR R2pV P                  '       d   \        W0P                  P                  R7      pVR,          ^ 8X  dV   \
        P                  ! VR,          4      pVR,           F+  pVP                  VR	,          VR
,          R,          34       K-  	  V# )zGet a list of containers present on the system.

:param get_all: If set, include stopped containers as well
:type get_all: ``bool``
z ps z-a z -o jsonZchrootstatusoutput
containersidZmetadataname)binaryactiver   policysysrootjsonloadsappend)r   Zget_allr   Z_cmdoutout_json	containers   &&     r   get_containersZ#CrioContainerRuntime.get_containers   s     
++d74";8D;;;(kk6I6IJC8}!::c(m4!),!7!7I%%"4)J*?*GHJ "8 r	   c                sH   . pV P                   '       Ed   \        V P                   R2V P                  P                  R7      pVR,          ^ 8X  d   \
        P                  ! VR,          4      pVR,           F  p\        VR,          4      ^ 8  d,   VR,           F  pVP                  WTR,          34       K  	  KE  \        VR,          4      ^ 8X  d   R	pM&VR,          ^ ,          P                  R
4      ^ ,          pVP                  VR,           VR,          34       K  	  V# )z|Get a list of images present on the system

:returns: A list of 2-tuples containing (image_name, image_id)
:rtype: ``list``
z images -o jsonr   r   r   imagesZrepoTagsr   ZrepoDigestsz<none>Z@z:<none>)
r   r   r   r   r   r   r   Zlenr   Zsplit)r   r   r   r   ZimageZrepo_tagZ
image_names   &      r   
get_imagesZCrioContainerRuntime.get_images,   s     ;;;(DKK=)H040C0CEC8}!::c(m4%h//E5,-1(-j(9(9H"MM84[*AB ): u]349)1J).})=a)@)F)Fs)KA)NJzI'=uT{&KL 0 r	   c                s    V'       d   \        V4      pMTpV P                  V4      pVe   V P                   RV RV 2# R# )ax  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``
Z r
   )r    Zget_container_by_nameZrun_cmd)r   r   ZcmdZquotecmdZ
quoted_cmdZcontainer_ids   &&&&  r   fmt_container_cmdZ&CrioContainerRuntime.fmt_container_cmdE   sR     sJJ11)<+ <<.,q= 	513	5r	   r   Nr   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s+     7DF$25 5r	   r   )r   Zshlexr    Zsos.policies.runtimesr   Zsos.utilitiesr   r   r   r	   r   <module>r      s"      2 0I5+ I5r	   