Skip to content

Commit 82fc1a9

Browse files
jcastillpmoravec
authored andcommitted
[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 <[email protected]>
1 parent c0e5148 commit 82fc1a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugins_overview.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def add_all_items(method, dest, plugfd, wrapopen=r'\(', wrapclose=r'\)'):
5555
# dirty hack to remove spaces and "Plugin"
5656
if "Plugin" not in it:
5757
continue
58-
it = it.strip(' ()')[0:-6]
58+
if "=" in it:
59+
it = re.sub(r"Plugin.*", "Plugin", it)
60+
plug_col_len = 9 if "PluginOpt" in it else 6
61+
it = it.strip(' ()')[:-plug_col_len]
5962
if len(it):
6063
dest.append(it)
6164
# list of specs separated by comma ..
@@ -94,7 +97,8 @@ def add_all_items(method, dest, plugfd, wrapopen=r'\(', wrapclose=r'\)'):
9497
pfd_content = pfd.read().replace('\n', '')
9598
add_all_items(
9699
"from sos.report.plugins import ", plugs_data[plugname]['distros'],
97-
pfd_content, wrapopen='', wrapclose='(class|from|import)'
100+
pfd_content, wrapopen='',
101+
wrapclose=r'(class|from|import|#|\))'
98102
)
99103
add_all_items("profiles = ", plugs_data[plugname]['profiles'],
100104
pfd_content, wrapopen='')

0 commit comments

Comments
 (0)