mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-advise: correct handling of plugin namespace iteration
The API object namespace iterators now yield plugin classes themselves instead of their names as strings. The method enumerating through available plugins needs to be made aware of this change. https://fedorahosted.org/freeipa/ticket/6044 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
a5efeb449b
commit
c1d8629b74
@ -167,12 +167,12 @@ class IpaAdvise(admintool.AdminTool):
|
||||
def print_config_list(self):
|
||||
self.print_header('List of available advices')
|
||||
|
||||
max_keyword_len = max((len(keyword) for keyword in advise_api.Advice))
|
||||
max_keyword_len = max(
|
||||
(len(advice.__name__) for advice in advise_api.Advice))
|
||||
|
||||
for keyword in advise_api.Advice:
|
||||
advice = getattr(advise_api.Advice, keyword, '')
|
||||
for advice in advise_api.Advice:
|
||||
description = getattr(advice, 'description', '')
|
||||
keyword = keyword.replace('_', '-')
|
||||
keyword = advice.__name__.replace('_', '-')
|
||||
|
||||
# Compute the number of spaces needed for the table to be aligned
|
||||
offset = max_keyword_len - len(keyword)
|
||||
|
Loading…
Reference in New Issue
Block a user