HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/landscape/lib/__pycache__/lsb_release.cpython-38.pyc
U

���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)Z
DISTRIB_IDZDISTRIB_DESCRIPTIONZDISTRIB_RELEASEZDISTRIB_CODENAMEc
Cs�|rtj�|�rt|�Sttjd��z}zttdg|d�}Wn,tt	fk
rft|�YW5QR�SX|�
��d�\}}}}}||||d�W5QR�SW5QRXdS)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�
)rrrrN)�os�path�exists�parse_lsb_release_file�open�devnullr�LSB_RELEASEr�FileNotFoundError�decode�split)Zlsb_release_filenameZFNULLZlsb_infoZdistZdescrZ	code_name�_�r�;/usr/lib/python3/dist-packages/landscape/lib/lsb_release.py�parse_lsb_releases�rc	Cs^i}t|��H}|D]<}|�d�\}}|tkrt|��}|���d�}|||<qW5QRX|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.
    �=�")rr�LSB_RELEASE_FILE_KEYS�strip)�filename�info�fd�line�key�valuerrrr)s
r)N)
�__doc__r�
subprocessrrrZLSB_RELEASE_FILENAMErrrrrrr�<module>s�