https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/python.cpython-310.pyc
o

-�_g'�@szddlZddlZddlZddlmZmZmZmZmZddl	m
Z
Gdd�de�ZGdd�deee�ZGdd	�d	ee�Z
dS)
�N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�
RHELPolicyc@s,eZdZdZdZdZdZdZdZdd�Z	d	S)
�PythonznCaptures information on the installed python runtime(s), as well as
    python modules installed via pip.
    zPython runtime�python)�system)r	z	python -VcCsX|j|jdd�|�d�}|ddkr(|d��dd�D]}|�|�d��qdSdS)	Nzpython-version)�suggest_filenamezwhereis pip -b�statusr�output�z list installed)�add_cmd_output�python_version�exec_cmd�split)�self�pips�pip�r�;/usr/lib/python3/dist-packages/sos/report/plugins/python.py�setup!s�
�zPython.setupN)
�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profiles�packagesrrrrrrrsrc@seZdZdZdZdS)�UbuntuPython�
python3 -V)�python3N)rrrrr rrrrr!.sr!csDeZdZdZdZedddd�gZ�fdd�Zd	d
�Zdd�Z	�Z
S)
�RedHatPythona In addition to the base information, on Red Hat family distributions the
    python plugin also supports the 'hashes' option. If enabled, this plugin
    will generate a json-formatted listing of all pyfiles within the
    distribution-standard python package installation locations.
    )r	�python36�python2r#zplatform-python�hashesFz#collect hashes for all python files)�default�desccs<|�ddg�t|jt�r|j��dkrd|_t���dS)Nz
python2 -Vr"�z/usr/libexec/platform-python -V)r�
isinstance�policyr�dist_versionr�superr)r��	__class__rrrAs
zRedHatPython.setupcCsV|�d�r)|�d��}|�tj|��dd��Wd�dS1s"wYdSdS)Nr'zdigests.json�)�indent)�
get_option�collection_file�write�json�dumps�
get_hashes)r�hfilerrr�collectHs

"��zRedHatPython.collectcCs�dgi}gd�}|D]n}t�|�|��D]c\}}}|D][}|�d�s#q|�||�}z<t|d��-}	t��}
|	�d�}|rG|
�|�|	�d�}|s;|
�	�}
|d�
||
d��Wd�n1s_wYWqtyv|�d|���Yqwqq
|S)	z! Get the hashes for Python files �digests)z/usr/libz
/usr/lib64z/usr/local/libz/usr/local/lib64z.py�rbi)�filepath�sha256NzUnable to read python file at )
�os�walk�	path_join�endswith�open�hashlibr>�read�update�	hexdigest�append�IOError�
_log_error)rr;�py_paths�py_path�root�_�files�_filer=�file�digest�datarrrr8Ms@�



�
�������zRedHatPython.get_hashes)rrrrr r�option_listrr:r8�
__classcell__rrr/rr$4s��r$)rDr6r?�sos.report.pluginsrrrrr�sos.policies.distros.redhatrrr!r$rrrr�<module>s


https://t.me/RX1948 - 2025