From 26c45f41c527f1193aa4a12814d7d07f5505fe07 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 19 Apr 2018 15:16:01 +0100 Subject: [yum] add plugin name list, package list, and config files Signed-off-by: Bryn M. Reeves --- sos/plugins/yum.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sos/plugins/yum.py b/sos/plugins/yum.py index 043f794c..1db5189a 100644 --- a/sos/plugins/yum.py +++ b/sos/plugins/yum.py @@ -13,6 +13,9 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from sos.plugins import Plugin, RedHatPlugin +import os + +YUM_PLUGIN_PATH = "/usr/lib/yum-plugins/" class Yum(Plugin, RedHatPlugin): @@ -44,6 +47,21 @@ class Yum(Plugin, RedHatPlugin): # Get a list of channels the machine is subscribed to. self.add_cmd_output("yum -C repolist") + # Get list of available plugins and their configuration files. + if os.path.exists(YUM_PLUGIN_PATH) and os.path.isdir(YUM_PLUGIN_PATH): + plugins = "" + names = "" + for p in os.listdir(YUM_PLUGIN_PATH): + if not p.endswith(".py"): + continue + plugins = plugins + " " if len(plugins) else "" + plugins = plugins + os.path.join(YUM_PLUGIN_PATH, p) + names += "%s\n" % p[:-3] + self.add_cmd_output("rpm -qf %s" % plugins) + self.add_string_as_file(names, "plugin-names") + + self.add_copy_spec("/etc/yum/pluginconf.d") + # candlepin info self.add_forbidden_path("/etc/pki/entitlement/key.pem") self.add_forbidden_path("/etc/pki/entitlement/*-key.pem") -- cgit