HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/dnf.cpython-39.pyc
a

\��h
�@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�RedHatPlugin�	PluginOptc@sLeZdZdZdZdZdZdZdZe	ddd	d
�gZ
dd�Zd
d�Zdd�Z
dS)�	DNFPlugina�
    The DNF plugin collects information for the dnf package manager and how it
    is configured for local system.

    By default, this plugin will collect configuration files from /etc/dnf,
    repo files defined in /etc/yum.repos.d/, module information, and various
    'dnf list' commands.

    When using the 'history-info' option, detailed transaction information will
    be collected for the most recent 50 dnf transactions, and will be saved to
    the sos_commands/dnf/history-info directory.
    zdnf package manager�dnf)�systemZpackagemanagerZsysmgmt)�/etc/dnf/dnf.conf)r�history-infoFz$collect detailed transaction history)�defaultZdesccCsH|sdS|��D]2}d|vr|��d}|dkr|jd|dd�qdS)z Get DN module information Nz[i]rzHint:zdnf module info Zdnf_module_info��tags)�
splitlines�split�add_cmd_output)�self�modules�line�module�r�:/usr/lib/python3.9/site-packages/sos/report/plugins/dnf.py�get_modules_info(s
�zDNFPlugin.get_modules_infoc	Cs�|�ddi�|�gd��|jdgd�d�|�d�rD|�d�n|�d	�|�d
�|�d�|jdd
d�|�gd��|jdddgd�|jdddgd�|�d�|�ddg�|�gd��|�d�s�|jddd�n�|jddd�}d}|d�rJ|d��D]>}z"t|�d�d�	��}W�qJWnt
�yDYn0�q
td t|d d!��D]}|jd"|��dd#d$��q^d%}|�|�}|�
|d�dS)&Nz/etc/dnf/modules.d/.*.moduleZdnf_modules)z	/etc/dnf/z
/etc/yum.confz/etc/yum/pluginconf.d/z/etc/yum/vars/z/etc/yum.repos.d/)Zyum_repos_dZdnf_repos_dZdnf_reporZall_logs�/var/log/dnf.*z/var/log/dnf.log*z/var/log/dnf.librepo.log*z/var/log/dnf.rpm.log*zdnf module listZdnf_module_list)z
dnf --versionzdnf list extraszdnf updateinfo info securityzdnf updateinfo list --availablezpackage-cleanup --dupeszpackage-cleanup --problemszdnf list installedZyum_list_installedZdnf_list_installedzdnf -C repolistZyum_repolistZdnf_repolistzdnf -C repolist --verbosez/etc/pki/entitlement/key.pemz/etc/pki/entitlement/*-key.pem)z/etc/pki/product/*.pemz/etc/pki/consumer/cert.pemz/etc/pki/entitlement/*.pemr	zdnf historyZdnf_history����output�|r��2zdnf history info Zdnf_history_info)Zsubdirrzdnf module list --installed)Z
add_file_tagsZ
add_copy_specZ
get_optionrZadd_forbidden_pathZcollect_cmd_outputr
�intr�strip�
ValueError�range�minr)r�historyZtransactionsrZtr_idZ
module_cmdrrrr�setup5sb��



�	��
�
�

�

zDNFPlugin.setupcCs@d}d}dD]}|�|||�q|�d||�|�ddg�dS)Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n)�/etc/yum.repos.d/*z/etc/dnf/vars/*rr$r)Zdo_path_regex_subZdo_file_subZdo_paths_http_sub)rZregexp�repl�filerrr�postproc�s	�zDNFPlugin.postprocN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesZpackagesrZoption_listrr#r'rrrrrs
��
MrN)Zsos.report.pluginsrrrrrrrr�<module>s