![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
o i��d� � @ s* d dl mZmZmZ G dd� dee�ZdS )� )�Plugin�RedHatPlugin� PluginOptc @ sL e Zd ZdZdZdZdZdZdZe ddd d �gZ dd� Zd d� Zdd� 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)�system�packagemanager�sysmgmt)�/etc/dnf/dnf.conf)r �history-infoFz$collect detailed transaction history)�default�descc C sH |sd S |� � D ]}d|v r!|�� d }|dkr!| jd| dd� qd S )Nz[i]r zHint:zdnf module info �dnf_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 C s� | � ddi� | �g d�� | jdg d�d� | �d�r"| �d� n| �d � | �d � | �d� | jdd d� | �g d�� | jdddgd� | jdddgd� | �d� | �ddg� | �g d�� | �d�sq| jddd� nD| jddd�}d}|d r�|d �� D ]}zt|�d�d � � �}W n t y� Y q�w td t|d d!��D ]}| jd"| dd#d$� q�d%}| �|�}| � |d � d S )&Nz/etc/dnf/modules.d/.*.module�dnf_modules)z /etc/dnf/z /etc/yum.confz/etc/yum/pluginconf.d/z/etc/yum/vars/z/etc/yum.repos.d/)�yum_repos_d�dnf_repos_d�dnf_repor �all_logsz/var/log/dnf.*z/var/log/dnf.log*z/var/log/dnf.librepo.log*z/var/log/dnf.rpm.log*zdnf module list�dnf_module_list)z dnf --versionzdnf list extraszpackage-cleanup --dupeszpackage-cleanup --problemszdnf list installed�yum_list_installed�dnf_list_installedzdnf -C repolist�yum_repolist�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 history�dnf_history����output�|r � �2 zdnf history info %d�dnf_history_info)�subdirr zdnf module list --installed)� add_file_tags� add_copy_spec� get_optionr �add_forbidden_path�collect_cmd_outputr �intr �strip� ValueError�range�minr )r �history�transactionsr �tr_id� module_cmdr r r r �setup4 sd �� ��� � �� � zDNFPlugin.setupc C s2 d}d}dD ] }| � |||� q| �d||� d S )Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n)z/etc/yum.repos.d/*z/etc/dnf/vars/*r )�do_path_regex_sub�do_file_sub)r �regexp�repl�fr r r �postproc~ s zDNFPlugin.postprocN)�__name__� __module__�__qualname__�__doc__� short_desc�plugin_name�profiles�files�packagesr �option_listr r; rA r r r r r s ��Jr N)�sos.report.pluginsr r r r r r r r �<module> s