U
    idb                     @   s&   d dl mZmZ G dd deeZdS )    )Plugin	SCLPluginc                   @   s0   e Zd ZdZdZdZdZdZdd Zdd	 Z	d
S )Redisz%Redis, in-memory data structure storeredis)services)r   z
rh-redis32z	rh-redis5z+/var/lib/config-data/puppet-generated/redisc              
   C   s   |  d| jd | jd | jd g | jdd  D ]*}|dd }| |ddd	d
ddg q2| d | dr|  dg n|  dg d S )Nz/etc/redis.confz/etc/redis*z/etc/redis/z/etc/security/limits.d/   z
rh-redis*-r   z/etc/redis.conf.puppetz/etc/redis-sentinel.confz/etc/redis-sentinel.conf.puppetz/var/log/redis/sentinel.logz/var/log/redis/redis.logzredis-cli infoZall_logsz/var/log/redis/redis.log*)Zadd_copy_specvar_puppet_genpackagessplitZadd_copy_spec_sclZadd_cmd_outputZ
get_option)selfpkgZscl r   :/usr/lib/python3/dist-packages/sos/report/plugins/redis.pysetup   s0    	

zRedis.setupc                 C   s.   d| j d ddfD ]}| |d dd qd S )Nz/etc/z/etc/opt/rh/rh-redis32/z/etc/opt/rh/rh-redis5/z
redis.confz(masterauth|requirepass)\s.*z\1 ********)r   Zdo_file_sub)r   pathr   r   r   postproc7   s    zRedis.postprocN)
__name__
__module____qualname__Z
short_descZplugin_nameZprofilesr	   r   r   r   r   r   r   r   r      s   r   N)Zsos.report.pluginsr   r   r   r   r   r   r   <module>   s   