plugins: Don't treat keys of api as bytes

The plugin `plugins` iterates over the keys of API instance,
__iter__ of which is a generator of class.__name__ from
(Command, Object, Method, Backend, Updater). So, the allowed type
is str, not bytes.

Fixes: https://pagure.io/freeipa/issue/8898
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin 2021-06-24 23:19:56 +03:00 committed by Alexander Bokovoy
parent 2e31e8479a
commit cf80244375

View File

@ -124,7 +124,7 @@ class plugins(LocalOrRemote):
for plugin in self.api[namespace]():
cls = type(plugin)
key = '{}.{}'.format(cls.__module__, cls.__name__)
result.setdefault(key, []).append(namespace.decode('utf-8'))
result.setdefault(key, []).append(namespace)
return dict(
result=result,