martbab's pull request #67: "advise: Use `name` instead of `__name__` to get plugin names" was opened
PR body: """ This change will allow ipa-advise to correctly handle advise plugins with custom names. """ See the full pull-request at https://github.com/freeipa/freeipa/pull/67 ... or pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/67/head:pr67 git checkout pr67
From c4555af51ccdf9e867436ec5e0349538da512baf Mon Sep 17 00:00:00 2001 From: Martin Babinsky <mbabi...@redhat.com> Date: Mon, 18 Jul 2016 10:44:23 +0200 Subject: [PATCH] advise: Use `name` instead of `__name__` to get plugin names This change will allow ipa-advise to correctly handle advise plugins with custom names. --- 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 a2dc9cc..f7e8ef5 100644 --- a/ipaserver/advise/base.py +++ b/ipaserver/advise/base.py @@ -168,11 +168,11 @@ def print_config_list(self): 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)
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code