| Current Path : /lib/python3/dist-packages/sos/policies/distros/__pycache__/ |
| Current File : //lib/python3/dist-packages/sos/policies/distros/__pycache__/cos.cpython-38.pyc |
U
���b� � @ s8 d dl mZmZ d dlmZ dd� ZG dd� de�ZdS )� )� 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 Zd ZdZdZdgZeegZdZ e
d dd��ZdS )
� CosPolicyzContainer-Optimized OSzGoogle Cloud Platform)zDistribution 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 |kS zBtdd��.}tdd� |D ��}|d dkW 5 Q R � W S Q R X W n ttfk
rj Y dS X d S )Nz/etc/os-release�rc s s$ | ]}t |�s|�� �d �V qdS )�=N)r r �split)�.0r r
r
r � <genexpr>. s �z"CosPolicy.check.<locals>.<genexpr>ZIDZcosF)�distro�open�dict�IOError�KeyError)�clsZremote�fpZ
os_releaser
r
r �check'