Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/dnf.cpython-36.pyc |
3
\��h
� @ s* d dl mZmZmZ G dd� dee�ZdS )� )�Plugin�RedHatPlugin� PluginOptc @ sL e Zd ZdZdZdZdZdZdZe dd d
d�gZ
dd
� Zdd� 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.confzhistory-infoFz$collect detailed transaction history)�defaultZdescc C sL |sdS x>|j � D ]2}d|kr|j� d }|dkr| jd| dd� qW dS )z Get DN module information Nz[i]r zHint:zdnf module info Zdnf_module_info)�tags)�
splitlines�split�add_cmd_output)�self�modules�line�module� r �/usr/lib/python3.6/dnf.py�get_modules_info( s
zDNFPlugin.get_modules_infoc C s� | j ddi� | jddddg� | jddd d
gd� | jd�rJ| jd
� n| jd� | jd� | jd� | jddd� | jddddddg� | jdddgd� | jdddgd� | jd� | jd d!g� | jd"d#d$g� | jd%�s�| jd&d'd� n�| jd&d'd�}d1}|d) �rZxJ|d) j� D ]:}yt|jd*�d+ j � �}P W n t
k
�rR Y nX �qW x4td(t|d( d,��D ]}| jd-|� �d%d.d/� �qpW d0}| j|�}| j
|d) � d S )2Nz/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_repo)r Zall_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 extraszdnf updateinfo info securityzdnf updateinfo list --availablezpackage-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/*.pemzhistory-infozdnf historyZdnf_history� �output�|r �2 zdnf history info Zdnf_history_info)Zsubdirr zdnf 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 �setup5 sl
zDNFPlugin.setupc C sD d}d}xdD ]}| j |||� qW | jd||� | jddg� d S )Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n�/etc/yum.repos.d/*�/etc/dnf/vars/*z/etc/dnf/dnf.confz/var/log/dnf.*)r# r$ )Zdo_path_regex_subZdo_file_subZdo_paths_http_sub)r Zregexp�repl�filer r r �postproc� s
zDNFPlugin.postprocN)r r r )r
)r )�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesZpackagesr Zoption_listr r"