U
    *b                     @   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                   @   s4   e Zd ZdZdZdgZeegZdZ	e
d	ddZd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:/sbin c              
   C   sp   |r| j |kS zBtdd.}tdd |D }|d dkW  5 Q R  W S Q R X W n ttfk
rj   Y dS X d S )Nz/etc/os-releaserc                 s   s$   | ]}t |s| d V  qdS )=N)r   r   split).0r	   r
   r
   r   	<genexpr>.   s    z"CosPolicy.check.<locals>.<genexpr>ZIDZcosF)distroopendictIOErrorKeyError)clsZremotefpZ
os_releaser
   r
   r   check'   s    
$zCosPolicy.checkN)r   )__name__
__module____qualname__r   ZvendorZvendor_urlsr   r   Zvalid_subclassesPATHclassmethodr   r
   r
   r
   r   r      s   r   N)Zsos.report.pluginsr   r   Zsos.policies.distrosr   r   r   r
   r
   r
   r   <module>   s   