From 5b9516753cae324126fac7e17b6918c08e210d59 Mon Sep 17 00:00:00 2001 From: Martin Babinsky Date: Mon, 18 Jul 2016 10:44:23 +0200 Subject: 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 --- ipaserver/advise/base.py | 4 ++-- 1 file 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) -- cgit