summaryrefslogtreecommitdiffstats
path: root/ipaserver/advise
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-07-11 14:03:36 +0200
committerPetr Vobornik <pvoborni@redhat.com>2016-07-12 11:02:52 +0200
commitc1d8629b7490f443eededf0c0d0472d8285f85e8 (patch)
treef2e536d2f7cec7a955664f805e09959c73ff8ec0 /ipaserver/advise
parenta5efeb449bba47dd430a7b8ffa594ace189252f4 (diff)
downloadfreeipa-c1d8629b7490f443eededf0c0d0472d8285f85e8.tar.gz
freeipa-c1d8629b7490f443eededf0c0d0472d8285f85e8.tar.xz
freeipa-c1d8629b7490f443eededf0c0d0472d8285f85e8.zip
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>
Diffstat (limited to 'ipaserver/advise')
-rw-r--r--ipaserver/advise/base.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py
index d083a3c50..a2dc9ccee 100644
--- a/ipaserver/advise/base.py
+++ b/ipaserver/advise/base.py
@@ -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)