diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2016-07-18 10:44:23 +0200 |
---|---|---|
committer | Martin Babinsky <mbabinsk@redhat.com> | 2016-09-08 17:28:24 +0200 |
commit | 5b9516753cae324126fac7e17b6918c08e210d59 (patch) | |
tree | da593f906703be4d68ac4dcfa08ba935c85f29f1 /ipaserver/advise | |
parent | c3374c6e16a10e8780401c58c04dcf8d95ea1a4d (diff) | |
download | freeipa-5b9516753cae324126fac7e17b6918c08e210d59.tar.gz freeipa-5b9516753cae324126fac7e17b6918c08e210d59.tar.xz freeipa-5b9516753cae324126fac7e17b6918c08e210d59.zip |
advise: Use `name` instead of `__name__` to get plugin names
This change will allow ipa-advise to correctly handle advise plugins with
custom names.
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipaserver/advise')
-rw-r--r-- | ipaserver/advise/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py index a2dc9ccee..f7e8ef5e4 100644 --- a/ipaserver/advise/base.py +++ b/ipaserver/advise/base.py @@ -168,11 +168,11 @@ class IpaAdvise(admintool.AdminTool): self.print_header('List of available advices') max_keyword_len = max( - (len(advice.__name__) for advice in advise_api.Advice)) + (len(advice.name) for advice in advise_api.Advice)) for advice in advise_api.Advice: description = getattr(advice, 'description', '') - keyword = advice.__name__.replace('_', '-') + keyword = advice.name.replace('_', '-') # Compute the number of spaces needed for the table to be aligned offset = max_keyword_len - len(keyword) |