o
    i©¹db  ã                   @   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 }|  |g d¢¡ q|  d	¡ |  d
¡r=|   dg¡ d S |   dg¡ d S )Nú/etc/redis.confz/etc/redis*z/etc/redis/z/etc/security/limits.d/é   z
rh-redis*-r   )r   z/etc/redis.conf.puppetz/etc/redis-sentinel.confz/etc/redis-sentinel.conf.puppetz/var/log/redis/sentinel.logú/var/log/redis/redis.logzredis-cli infoÚall_logsz/var/log/redis/redis.log*r	   )Úadd_copy_specÚvar_puppet_genÚpackagesÚsplitÚadd_copy_spec_sclÚadd_cmd_outputÚ
get_option)ÚselfÚpkgÚscl© r   ú:/usr/lib/python3/dist-packages/sos/report/plugins/redis.pyÚsetup   s"   ü
	

ÿ
ÿ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   Údo_file_sub)r   Úpathr   r   r   Úpostproc7   s   ýýüzRedis.postprocN)
Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesr   r   r   r   r   r   r   r   r      s    r   N)Úsos.report.pluginsr   r   r   r   r   r   r   Ú<module>   s   