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: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/dnf.cpython-38.pyc
U

i��d��@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|kr|��d}|dkr|jd|dd�qdS)Nz[i]rzHint:zdnf module info Zdnf_module_info��tags)�
splitlines�split�add_cmd_output)�self�modules�line�module�r�8/usr/lib/python3/dist-packages/sos/report/plugins/dnf.py�get_modules_info(s
�zDNFPlugin.get_modules_infoc	Cs�|�ddi�|�ddddg�|jddd	d
gd�|�d�rJ|�d
�n|�d�|�d�|�d�|jddd�|�ddddg�|jdddgd�|jdddgd�|�d�|�ddg�|�d d!d"g�|�d#�s�|jd$d%d�n�|jd$d%d�}d&}|d'�rX|d'��D]@}z"t|�d(�d)�	��}W�qXWnt
k
�rRYnX�qtd*t|d*d+��D]}|jd,|d#d-d.��qld/}|�|�}|�
|d'�dS)0Nz/etc/dnf/modules.d/.*.moduleZdnf_modulesz	/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_logsz/var/log/dnf.*z/var/log/dnf.log*z/var/log/dnf.librepo.log*z/var/log/dnf.rpm.log*zdnf module listZdnf_module_listz
dnf --versionzdnf list extraszpackage-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.pemz/etc/pki/product/*.pemz/etc/pki/consumer/cert.pemz/etc/pki/entitlement/*.pemr	zdnf historyZdnf_history����output�|r��2zdnf history info %dZdnf_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�setup4s����



����
��
�


�

zDNFPlugin.setupcCs2d}d}dD]}|�|||�q|�d||�dS)Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n)z/etc/yum.repos.d/*z/etc/dnf/vars/*r)Zdo_path_regex_subZdo_file_sub)rZregexp�repl�frrr�postproc~s
	zDNFPlugin.postprocN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesZpackagesrZoption_listrr"r%rrrrrs
��JrN)Zsos.report.pluginsrrrrrrrr�<module>s