Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/dnf.cpython-36.opt-1.pyc

3

�f��@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�RedHatPlugin�	PluginOptc@sLeZdZdZdZdZdZdZdZe	dd	d
d�gZ
dd
�Zdd�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�system�packagemanager�sysmgmt�/etc/dnf/dnf.confzhistory-infoFz$collect detailed transaction history)�defaultZdesccCsL|sdSx>|j�D]2}d|kr|j�d}|dkr|jd|dd�qWdS)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.6/dnf.py�get_modules_info(s
zDNFPlugin.get_modules_infocCs�|jddi�|jddddg�|jddd	d
gd�|jd�rJ|jd
�n|jd�|jd�|jd�|jddd�|jddddg�|jdddgd�|jdddgd�|jd�|jddg�|jd d!d"g�|jd#�s�|jd$d%d�n�|jd$d%d�}d/}|d'�rVxJ|d'j�D]:}yt|jd(�d)j	��}PWnt
k
�rNYnX�qWx2td&t|d&d*��D]}|jd+|d#d,d-��qlWd.}|j|�}|j
|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_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 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/*.pemzhistory-infozdnf 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�setup5sh









zDNFPlugin.setupcCs6d}d}xdD]}|j|||�qW|jd||�dS)Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n�/etc/yum.repos.d/*�/etc/dnf/vars/*z/etc/dnf/dnf.conf)r#r$)Zdo_path_regex_subZdo_file_sub)rZregexp�repl�filerrr�postprocs
	
zDNFPlugin.postprocN)rrr	)r
)r)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesZpackagesrZoption_listrr"r'rrrrrs

JrN)Zsos.report.pluginsrrrrrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists