From 32602fee66996a45d810653d62edc14b2e4c4550 Mon Sep 17 00:00:00 2001 From: Jose Castillo Date: Tue, 8 Jul 2025 09:44:55 +0100 Subject: [PATCH] [report] Fix formatting of distros in plugins_overview The formatting of the distros column was leaving the string 'Plu' when it found 'PluginOpt'. This fix explicitly deals with both 'PluginOpt' and 'Plugin' strings and removes them. Signed-off-by: Jose Castillo --- plugins_overview.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins_overview.py b/plugins_overview.py index f7ef042958..b315519051 100644 --- a/plugins_overview.py +++ b/plugins_overview.py @@ -55,7 +55,10 @@ def add_all_items(method, dest, plugfd, wrapopen=r'\(', wrapclose=r'\)'): # dirty hack to remove spaces and "Plugin" if "Plugin" not in it: continue - it = it.strip(' ()')[0:-6] + if "=" in it: + it = re.sub(r"Plugin.*", "Plugin", it) + plug_col_len = 9 if "PluginOpt" in it else 6 + it = it.strip(' ()')[:-plug_col_len] if len(it): dest.append(it) # list of specs separated by comma .. @@ -94,7 +97,8 @@ def add_all_items(method, dest, plugfd, wrapopen=r'\(', wrapclose=r'\)'): pfd_content = pfd.read().replace('\n', '') add_all_items( "from sos.report.plugins import ", plugs_data[plugname]['distros'], - pfd_content, wrapopen='', wrapclose='(class|from|import)' + pfd_content, wrapopen='', + wrapclose=r'(class|from|import|#|\))' ) add_all_items("profiles = ", plugs_data[plugname]['profiles'], pfd_content, wrapopen='')