diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2019-03-19 17:24:14 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-19 17:24:14 +0000 |
commit | 39995744dcc81df56baf173fdbfc1b1a037f3ced (patch) | |
tree | f2c6f9cf7536f4fd6c88005a88be5d596940d190 | |
parent | 2e45d7c28fe5ed7daaa009a6dde5b85094938eb5 (diff) | |
download | sos-39995744dcc81df56baf173fdbfc1b1a037f3ced.tar.gz |
[insights] fix handling of configs tuple
The configs member is now a tuple: we can't just slam it into a
add_copy_specs() list or a do_file_sub() call and have it work.
Split out the a_c_s() and pass the tuple alone (it looks less ugly
than having a cons inside the list), and loop over the elements in
postproc to handle the possible file locations.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/insights.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sos/plugins/insights.py b/sos/plugins/insights.py index f4fd542f..720d33a6 100644 --- a/sos/plugins/insights.py +++ b/sos/plugins/insights.py @@ -21,11 +21,10 @@ class RedHatInsights(Plugin, RedHatPlugin): ) def setup(self): - self.add_copy_spec([ - self.config, - # Legacy log file location - "/var/log/redhat-access-insights/*.log" - ]) + self.add_copy_spec(self.config) + + # Legacy log file location + self.add_copy_spec("/var/log/redhat-access-insights/*.log") if self.get_option("all_logs"): self.add_copy_spec("/var/log/insights-client/*.log*") @@ -33,14 +32,11 @@ class RedHatInsights(Plugin, RedHatPlugin): self.add_copy_spec("/var/log/insights-client/insights-client.log") def postproc(self): - self.do_file_sub( - self.conf_file, - r'(password[\t\ ]*=[\t\ ]*)(.+)', - r'\1********' - ) - - self.do_file_sub( - self.conf_file, - r'(proxy[\t\ ]*=.*)(:)(.*)(@.*)', - r'\1\2********\4' - ) + for conf in self.config: + self.do_file_sub( + conf, r'(password[\t\ ]*=[\t\ ]*)(.+)', r'\1********' + ) + + self.do_file_sub( + conf, r'(proxy[\t\ ]*=.*)(:)(.*)(@.*)', r'\1\2********\4' + ) |