
    ~ g                     0    S SK JrJrJr   " S S\\5      rg)    )PluginRedHatPlugin	PluginOptc                   P    \ rS rSrSrSrSrSrSrSr	\
" SS	S
S9/rS rS rS rSrg)	DNFPlugin   a  
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.
zdnf package managerdnf)systempackagemanagersysmgmt)/etc/dnf/dnf.conf)r	   history-infoFz$collect detailed transaction history)defaultdescc                     U(       d  gUR                  5        H9  nSU;   d  M  UR                  5       S   nUS:w  d  M&  U R                  SU-   SS9  M;     g)zGet DN module information Nz[i]r   zHint:zdnf module info dnf_module_infotags)
splitlinessplitadd_cmd_output)selfmoduleslinemodules       8/usr/lib/python3/dist-packages/sos/report/plugins/dnf.pyget_modules_infoDNFPlugin.get_modules_info(   sZ     &&(D}aW$''(:V(C-> ( @	 )    c                    U R                  SS05        U R                  / SQ5        U R                  S/ SQS9  U R                  S5      (       a  U R                  S5        O3U R                  S	5        U R                  S
5        U R                  S5        U R                  SSS9  U R                  / SQ5        U R                  SSS/S9  U R                  SSS/S9  U R                  S5        U R	                  SS/5        U R                  / SQ5        U R                  S5      (       d  U R                  SSS9  OU R                  SSS9nSnUS   (       aF  US   R                  5        H/  n [        UR                  S5      S   R                  5       5      n  O   [        S [        US -   S!5      5       H  nU R                  S"U 3SS#S$9  M     S%nU R                  U5      nU R                  US   5        g ! [         a     M  f = f)&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*zdnf module listdnf_module_list)zdnf --versionzdnf list extraszpackage-cleanup --dupeszpackage-cleanup --problemszdnf list installedyum_list_installeddnf_list_installedzdnf -C repolistyum_repolistdnf_repolistzdnf -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   zdnf historydnf_historyoutput|r      2   zdnf history info dnf_history_info)subdirr   zdnf 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   s          r   setupDNFPlugin.setup5   sS   *M
 	 	 
 	 	. J 	 	L ??:&&/023:;67-!2 	 	4 	 
 	 	0"68L!M 	 	O 	-"0.!A 	 	C 	78*,!
 	
 	 
 	 ~..MB--m3@ . BGLx #H-88:D'*4::c?1+=+C+C+E'F ; q#l1nb"9:##&7w$?+9); $ = ; 3
))*5gh/0 & s   ,+G77
HHc                 f    SnSnS H  nU R                  X1U5        M     U R                  SX5        g )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files       r   postprocDNFPlugin.postproc   s;     1=D""46 > 	,f;r    N)__name__
__module____qualname____firstlineno____doc__
short_descplugin_nameprofilesfilespackagesr   option_listr   rA   rI   __static_attributes__rK   r   r   r   r      sL     'JK6H"EH 	.%=	?K
@I1V<r   r   N)sos.report.pluginsr   r   r   r   rK   r   r   <module>rY      s    ? >I< I<r   