o
    *bö  ã                   @   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 infoZall_logsz/var/log/redis/redis.log*r	   )Zadd_copy_specÚvar_puppet_genÚpackagesÚsplitZadd_copy_spec_sclZadd_cmd_outputZ
get_option)ÚselfZpkgZ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¡ |  |d dd¡ q	d S )	Nz/etc/z/etc/opt/rh/rh-redis32/z/etc/opt/rh/rh-redis5/z
redis.confz(masterauth\s).*z
\1********z(requirepass\s).*zrequirepass = ********)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   