File: //lib/python3/dist-packages/landscape/lib/__pycache__/lsb_release.cpython-38.pyc
U
���cJ � @ sH d Z ddlZddlmZmZ dZdZdddd d
�Zddd�Zd
d� Z dS )z*Get information from /usr/bin/lsb_release.� N)�CalledProcessError�check_outputz/usr/bin/lsb_releasez/etc/lsb_release�distributor-id�description�release� code-name)Z
DISTRIB_IDZDISTRIB_DESCRIPTIONZDISTRIB_RELEASEZDISTRIB_CODENAMEc
C s� | rt j�| �rt| �S tt jd��z}zttdg|d�}W n, tt fk
rf t| � Y W 5 Q R � S X |�
� �d�\}}}}}||||d�W 5 Q R � S W 5 Q R X dS )z�
Returns a C{dict} holding information about the system LSB release.
Reads from C{lsb_release_filename} if it exists, else calls
C{LSB_RELEASE}
�wz-as)�stderr�
)r r r r N)�os�path�exists�parse_lsb_release_file�open�devnullr �LSB_RELEASEr �FileNotFoundError�decode�split)Zlsb_release_filenameZFNULLZlsb_infoZdistZdescr Z code_name�_� r �;/usr/lib/python3/dist-packages/landscape/lib/lsb_release.py�parse_lsb_release s �r c C s^ i }t | ��H}|D ]<}|�d�\}}|tkrt|�� }|�� �d�}|||<