mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user