diff options
author | Jan Jansky <jjansky@redhat.com> | 2020-05-12 17:02:07 +0200 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-05-12 12:22:47 -0400 |
commit | 7fd6b8a4741fc8c3b842ddc2b09e8921ef199c81 (patch) | |
tree | beed352592b06f073b65d0bd47643eea39a39719 | |
parent | 141f2517b15f6e92d82bb19fc537681e8e34907f (diff) | |
download | sos-7fd6b8a4741fc8c3b842ddc2b09e8921ef199c81.tar.gz |
[redis] Collection of redis from scl
As preparation for Satellite 7 configuration and log
collection adding collection of rh-redis32 from scl.
Resolves: #2016
Signed-off-by: Jan Jansky <jjansky@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/report/plugins/redis.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/sos/report/plugins/redis.py b/sos/report/plugins/redis.py index d81d0a44..26f0d164 100644 --- a/sos/report/plugins/redis.py +++ b/sos/report/plugins/redis.py @@ -9,23 +9,19 @@ # # See the LICENSE file in the source distribution for further information. -from sos.report.plugins import Plugin, RedHatPlugin +from sos.report.plugins import Plugin, SCLPlugin -class Redis(Plugin, RedHatPlugin): +class Redis(Plugin, SCLPlugin): short_desc = 'Redis, in-memory data structure store' plugin_name = 'redis' profiles = ('services',) - packages = ('redis',) + packages = ('redis', 'rh-redis32', 'rh-redis5') + var_puppet_gen = "/var/lib/config-data/puppet-generated/redis" - files = ( - '/etc/redis.conf', - '/var/log/redis', - var_puppet_gen + '/etc/redis.conf' - ) def setup(self): self.add_copy_spec([ @@ -35,6 +31,17 @@ class Redis(Plugin, RedHatPlugin): self.var_puppet_gen + "/etc/security/limits.d/" ]) + for pkg in self.packages[1:]: + scl = pkg.split('rh-redis*-')[0] + self.add_copy_spec_scl(scl, [ + '/etc/redis.conf', + '/etc/redis.conf.puppet', + '/etc/redis-sentinel.conf', + '/etc/redis-sentinel.conf.puppet', + '/var/log/redis/sentinel.log', + '/var/log/redis/redis.log' + ]) + self.add_cmd_output("redis-cli info") if self.get_option("all_logs"): self.add_copy_spec([ @@ -46,26 +53,19 @@ class Redis(Plugin, RedHatPlugin): ]) def postproc(self): - self.do_file_sub( - "/etc/redis.conf", - r"(masterauth\s).*", - r"\1********" - ) - self.do_file_sub( - "/etc/redis.conf", - r"(requirepass\s).*", - r"\1********" - ) - self.do_path_regex_sub( - self.var_puppet_gen + "/etc/redis.conf*", - r"(masterauth\s).*", - r"\1*********" - ) - self.do_path_regex_sub( - self.var_puppet_gen + "/etc/redis.conf*", - r"(requirepass\s).*", - r"\1*********" - ) - + for path in ["/etc/", + self.var_puppet_gen + "/etc/", + "/etc/opt/rh/rh-redis32/", + "/etc/opt/rh/rh-redis5/"]: + self.do_file_sub( + path + "redis.conf", + r"(masterauth\s).*", + r"\1********" + ) + self.do_file_sub( + path + "redis.conf", + r"(requirepass\s).*", + r"requirepass = ********" + ) # vim: set et ts=4 sw=4 : |