aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2021-06-24 17:59:36 +0200
committerJake Hunsaker <jhunsake@redhat.com>2021-06-24 12:44:04 -0400
commit0286034da44bce43ab368dfc6815da7d74d60719 (patch)
tree0c77e4daea161cd0e1be16b4d7ae11a01027f600
parentb695201baeb629a6543445d98dbb04f357670621 (diff)
downloadsos-0286034da44bce43ab368dfc6815da7d74d60719.tar.gz
[rhui] call rhui-* commands with proper env and timeout
rhui-manager commands timeout when not being logged in, which should be reacted by adding proper cmd timeout. Adding the env.variable ensures potentially unaswered "RHUI Username:" is also printed/colected. Further, prevent collecting any *.key file from the whole /etc/pki/rhui dir. Related: #2593 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/report/plugins/rhui.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sos/report/plugins/rhui.py b/sos/report/plugins/rhui.py
index 7acd3f49..5a152427 100644
--- a/sos/report/plugins/rhui.py
+++ b/sos/report/plugins/rhui.py
@@ -29,13 +29,16 @@ class Rhui(Plugin, RedHatPlugin):
"/root/.rhui/*",
])
# skip collecting certificate keys
- self.add_forbidden_path("/etc/pki/rhui/*.key")
+ self.add_forbidden_path("/etc/pki/rhui/**/*.key", recursive=True)
+ # call rhui-manager commands with 1m timeout and
+ # with an env. variable ensuring that "RHUI Username:"
+ # even unanswered prompt gets collected
self.add_cmd_output([
"rhui-manager status",
"rhui-manager cert info",
"ls -lR /var/lib/rhui/remote_share",
- ])
+ ], timeout=60, env={'PYTHONUNBUFFERED': '1'})
def postproc(self):
# obfuscate admin_pw and secret_key values