o
    *b\                     @   s&   d dl mZmZ G dd deeZdS )    )PluginRedHatPluginc                   @   s0   e Zd ZdZdZdZdZdZdd Zdd	 Z	d
S )RedHatInsightsz,Collect config and logs for Red Hat InsightsZinsights)zredhat-access-insightszinsights-client)systemZsysmgmt)z)/etc/insights-client/insights-client.confz /etc/insights-client/.registeredz7/etc/redhat-access-insights/redhat-access-insights.confc                 C   sH   |  | j |  d | dr|  d n|  d | jddd d S )Nz%/var/log/redhat-access-insights/*.logZall_logsz/var/log/insights-client/*.log*z,/var/log/insights-client/insights-client.logz-insights-client --test-connection --net-debug   )Ztimeout)Zadd_copy_specconfigZ
get_optionZadd_cmd_output)self r	   =/usr/lib/python3/dist-packages/sos/report/plugins/insights.pysetup   s   



zRedHatInsights.setupc                 C   s,   | j D ]}| |dd | |dd qd S )Nz(password[\t\ ]*=[\t\ ]*)(.+)z
\1********z(proxy[\t\ ]*=.*)(:)(.*)(@.*)z\1\2********\4)r   Zdo_file_sub)r   confr	   r	   r
   postproc(   s   
zRedHatInsights.postprocN)
__name__
__module____qualname__Z
short_descZplugin_nameZpackagesZprofilesr   r   r   r	   r	   r	   r
   r      s    r   N)Zsos.report.pluginsr   r   r   r	   r	   r	   r
   <module>   s   