HEX
Server: nginx/1.28.0
System: Linux server-one 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
User: root (0)
PHP: 8.3.23
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/landscape/lib/__pycache__/lsb_release.cpython-310.pyc
o

���cJ�@sHdZddlZddlmZmZdZdZdddd	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)�
DISTRIB_ID�DISTRIB_DESCRIPTION�DISTRIB_RELEASE�DISTRIB_CODENAMEc
Cs�|rtj�|�rt|�Sttjd��<}z
ttdg|d�}Wntt	fy3t|�YWd�Sw|�
��d�\}}}}}||||d�Wd�S1sQwYdS)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)�stderrN�
)rrrr)�os�path�exists�parse_lsb_release_file�open�devnullr�LSB_RELEASEr�FileNotFoundError�decode�split)�lsb_release_filename�FNULL�lsb_info�dist�descr�	code_name�_�r �;/usr/lib/python3/dist-packages/landscape/lib/lsb_release.py�parse_lsb_releases 
��$�r"cCsti}t|��*}|D]}|�d�\}}|tvr't|��}|���d�}|||<q	Wd�|S1s3wY|S)z�
    Returns a C{dict} holding information about the system LSB release
    by attempting to parse C{filename}.

    @raises: A FileNotFoundError if C{filename} does not exist.
    �=�"N)rr�LSB_RELEASE_FILE_KEYS�strip)�filename�info�fd�line�key�valuer r r!r)s
��
�	�	r)N)
�__doc__r�
subprocessrrr�LSB_RELEASE_FILENAMEr%r"rr r r r!�<module>s�