diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-06-20 08:52:35 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-06-28 13:30:49 +0200 |
commit | 9a21964877c4bb64599e75ca708ec83a72abeb51 (patch) | |
tree | a56a9353b3c998a121c9bdc767b58031082945f1 /ipaserver | |
parent | 22f26cfa8e06e08795a6ad611bb7c72f003e65c4 (diff) | |
download | freeipa-9a21964877c4bb64599e75ca708ec83a72abeb51.tar.gz freeipa-9a21964877c4bb64599e75ca708ec83a72abeb51.tar.xz freeipa-9a21964877c4bb64599e75ca708ec83a72abeb51.zip |
misc: generate `plugins` result directly in the command
Move the code that generated result of the `plugins` command from API to
the command itself.
https://fedorahosted.org/freeipa/ticket/4427
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/plugins/misc.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ipaserver/plugins/misc.py b/ipaserver/plugins/misc.py index 0628bb19b..7618e23a9 100644 --- a/ipaserver/plugins/misc.py +++ b/ipaserver/plugins/misc.py @@ -133,6 +133,13 @@ class plugins(LocalOrRemote): ) def execute(self, **options): + result = {} + for namespace in self.api: + for plugin in self.api[namespace](): + cls = type(plugin) + key = '{}.{}'.format(cls.__module__, cls.__name__) + result.setdefault(key, []).append(namespace) + return dict( - result=dict(self.api.plugins), + result=result, ) |