o
G%@i
@ s* d dl mZmZmZ G dd deeZdS ) )PluginRedHatPlugin 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 managerdnf)systempackagemanagersysmgmt)/etc/dnf/dnf.conf)r history-infoFz$collect detailed transaction history)defaultdescc C sH |sdS | D ]}d|v r!| d }|dkr!| jd| dd qdS )z Get DN module information Nz[i]r zHint:zdnf module info dnf_module_infotags)
splitlinessplitadd_cmd_output)selfmoduleslinemodule r 8/usr/lib/python3/dist-packages/sos/report/plugins/dnf.pyget_modules_info( s
zDNFPlugin.get_modules_infoc C s | ddi | g d | jdg dd | dr"| d n| d | d
| d | jdd
d | g d | jdddgd | jdddgd | d | ddg | g d | dsq| jddd nE| jddd}d}|d r|d D ]}zt|dd }W n t
y Y qw td t|d d!D ]
}| jd"| dd#d$ qd%}| |}|
|d d S )&Nz/etc/dnf/modules.d/.*.modulednf_modules)z /etc/dnf/z
/etc/yum.confz/etc/yum/pluginconf.d/z/etc/yum/vars/z/etc/yum.repos.d/)yum_repos_ddnf_repos_ddnf_repor all_logs/var/log/dnf.*z/var/log/dnf.log*z/var/log/dnf.librepo.log*z/var/log/dnf.rpm.log*zdnf module listdnf_module_list)z
dnf --versionzdnf list extraszdnf updateinfo info securityzdnf updateinfo list --availablezpackage-cleanup --dupeszpackage-cleanup --problemszdnf list installedyum_list_installeddnf_list_installedzdnf -C repolistyum_repolistdnf_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 historydnf_historyoutput|r 2 zdnf history info dnf_history_info)subdirr zdnf module list --installed)
add_file_tags
add_copy_spec
get_optionr add_forbidden_pathcollect_cmd_outputr intr strip
ValueErrorrangeminr )r historytransactionsr tr_id
module_cmdr r r r setup5 sd
zDNFPlugin.setupc C s@ d}d}dD ] }| ||| q| d|| | ddg d S )Nz(password(\s)*=(\s)*)(\S+)\nz\1********\n)/etc/yum.repos.d/*z/etc/dnf/vars/*r
r= r )do_path_regex_subdo_file_subdo_paths_http_sub)r regexpreplfiler r r postproc s
zDNFPlugin.postprocN)__name__
__module____qualname____doc__
short_descplugin_nameprofilesfilespackagesr option_listr r<