aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2021-02-17 22:27:06 +0100
committerPavel Moravec <pmoravec@redhat.com>2021-02-17 22:27:06 +0100
commitd810d4d7aa5dc49044a5fbc665983071f6a03cb5 (patch)
treec4f8505a371bd0373f08bb905f2990b5bdbd6aa5
parentbf622ae28b9a759161cbe6dda9c425d72408feaa (diff)
downloadsos-d810d4d7aa5dc49044a5fbc665983071f6a03cb5.tar.gz
[report] add enabling packages per plugin to the overview
Add list of packages enabling a plugin into plugins_overview.py . Closes: #2404 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--plugins_overview.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins_overview.py b/plugins_overview.py
index 4eb2f694..26c3d38f 100644
--- a/plugins_overview.py
+++ b/plugins_overview.py
@@ -1,7 +1,9 @@
# this script generates for each plugin:
+# - its name
# - URL to upstream code
# - list of distros
# - list of profiles
+# - list of packages that enable the plugin (no other enabling pieces)
# - list of paths it collects (add_copy_spec)
# - list of paths it forbits to collect (add_forbidden_path)
# - list of commands it calls (add_cmd_output)
@@ -74,6 +76,7 @@ for plugfile in sorted(os.listdir(PLUGDIR)):
'sourcecode': 'https://github.com/sosreport/sos/blob/master/sos/report/plugins/%s.py' % plugname,
'distros': [],
'profiles': [],
+ 'packages': [],
'copyspecs': [],
'forbidden': [],
'commands': [],
@@ -84,6 +87,7 @@ for plugfile in sorted(os.listdir(PLUGDIR)):
plugcontent = open(os.path.join(PLUGDIR, plugfile)).read().replace('\n','')
add_all_items("from sos.report.plugins import ", plugs_data[plugname]['distros'], wrapopen='', wrapclose='(class|from|import)')
add_all_items("profiles = ", plugs_data[plugname]['profiles'], wrapopen='')
+ add_all_items("packages = ", plugs_data[plugname]['packages'], wrapopen='')
add_all_items("add_copy_spec", plugs_data[plugname]['copyspecs'])
add_all_items("add_forbidden_path", plugs_data[plugname]['forbidden'])
add_all_items("add_cmd_output", plugs_data[plugname]['commands'])
@@ -94,7 +98,7 @@ for plugfile in sorted(os.listdir(PLUGDIR)):
# print output; if "csv" is cmdline argument, print in CSV format, else JSON
if (len(sys.argv) > 1) and (sys.argv[1] == "csv"):
- print("plugin;url;distros;profiles;copyspecs;forbidden;commands;service_status;journals;env_vars")
+ print("plugin;url;distros;profiles;packages;copyspecs;forbidden;commands;service_status;journals;env_vars")
for plugname in plugs_data.keys():
plugin = plugs_data[plugname]
# determine max number of lines - usually "max(len(copyspec),len(commands))"