| Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
| Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/dnf.cpython-38.pyc |
U
���b& � @ 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)�systemZpackagemanagerZsysmgmt)z/etc/dnf/dnf.conf)r �history-infoFz$collect detailed transaction history)�defaultZdescc C sH |sd S |� � D ]2}d|kr|�� d }|dkr| jd| dd� qd S )Nz[i]r zHint:zdnf --assumeno 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 C s� | � ddi� | �d� | jddddgd� | �d �rB| �d
� n| �d� | �d� | �d
� | jddd� | �dddddg� | jdddgd� | jdddgd� | �d� | �ddg� | �ddd g� | �d!�s�| jd"d#d� n�| jd"d#d�}d$}|d% �rR|d% �� D ]@}z"t|�d&�d' � � �}W �qRW n t
k
�rL Y nX �qtd(t|d( d)��D ]}| jd*| d!d+d,� �qfd-}| �|�}| �
|d% � d S ).Nz/etc/dnf/modules.d/.*.moduleZdnf_modulesz /etc/dnf/z/etc/yum.repos.d/Zyum_repos_dZdnf_repos_dZdnf_repor
Zall_logsz/var/log/dnf.*z/var/log/dnf.log*z/var/log/dnf.librepo.log*z/var/log/dnf.rpm.log*zdnf --assumeno module listZdnf_module_listz
dnf --versionz#dnf --assumeno list installed *dnf*zdnf --assumeno list extraszpackage-cleanup --dupeszpackage-cleanup --problemszdnf list installedZyum_list_installedZdnf_list_installedzdnf -C repolistZyum_repolistZdnf_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 � �2 zdnf history info %dZdnf_history_info)Zsubdirr z&dnf --assumeno module list --installed)Z
add_file_tagsZ
add_copy_specZ
get_optionr Zadd_forbidden_pathZcollect_cmd_outputr �intr
�strip�
ValueError�range�minr )r �historyZtransactionsr Ztr_idZ
module_cmdr r r r �setup4 sx �
�
����
��
�
�
zDNFPlugin.setupc C s d}d}| � d||� d S )Nz"(proxy_password(\s)*=(\s)*)(\S+)\nz\1********\nz/etc/yum.repos.d/*)Zdo_path_regex_sub)r Zregexp�replr r r �postprocz s zDNFPlugin.postprocN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesZpackagesr Zoption_listr r! r# r r r r r s
��Fr N)Zsos.report.pluginsr r r r r r r r �<module> s