o
    id                     @   s8   d dl mZmZ d dlmZ dd ZG dd deZdS )    )	CosPluginIndependentPlugin)LinuxPolicyc                 C   s   |    p|  dS )aH  Test whether line is empty of contains a comment.

        Test whether the ``line`` argument is either blank, or a
        whole-line comment.

        :param line: the line of text to be checked.
        :returns: ``True`` if the line is blank or a comment,
                  and ``False`` otherwise.
        :rtype: bool
    #)striplstrip
startswith)line r
   :/usr/lib/python3/dist-packages/sos/policies/distros/cos.py_blank_or_comment   s   r   c                       sJ   e Zd ZdZdZdgZeegZdZ			d fdd	Z
edd
dZ  ZS )	CosPolicyzContainer-Optimized OSzGoogle Cloud Platform)zDistribution Websitez0https://cloud.google.com/container-optimized-os/z</usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbinNTc                    s,   t t| j||||d |  jtg7  _d S )N)sysrootinitprobe_runtimeremote_exec)superr   __init__valid_subclasses)selfr   r   r   r   	__class__r
   r   r   '   s
   zCosPolicy.__init__ c              	   C   sx   |r| j |v S z(tdd}tdd |D }|d dkW  d    W S 1 s(w   Y  W d S  ttfy;   Y dS w )Nz/etc/os-releaserc                 s   s&    | ]}t |s| d V  qdS )=N)r   r   split).0r	   r
   r
   r   	<genexpr>5   s    z"CosPolicy.check.<locals>.<genexpr>IDcosF)distroopendictIOErrorKeyError)clsremotefp
os_releaser
   r
   r   check.   s   

(zCosPolicy.check)NNTN)r   )__name__
__module____qualname__r    vendorvendor_urlsr   r   r   PATHr   classmethodr)   __classcell__r
   r
   r   r   r      s    r   N)sos.report.pluginsr   r   sos.policies.distrosr   r   r   r
   r
   r
   r   <module>   s   
