From 7706dfaf09ac1c9acc1e711c67a1ea42d5113b6d Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Fri, 13 Aug 2021 14:29:55 +0300 Subject: [PATCH] schema plugin: Fix commands without metaobject arg Previously, all the commands of schema plugin derived from BaseMetaSearch require metaobject as their argument (by implementation), but the spec for some of them only optionally asks for search criteria arg. This patch fixes this inconsistency. Fixes: https://pagure.io/freeipa/issue/8954 Signed-off-by: Stanislav Levin Reviewed-By: Florence Blanc-Renaud --- ipaserver/plugins/schema.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ipaserver/plugins/schema.py b/ipaserver/plugins/schema.py index 915defccd..dd5f2fa52 100644 --- a/ipaserver/plugins/schema.py +++ b/ipaserver/plugins/schema.py @@ -129,8 +129,8 @@ class BaseMetaSearch(Search): "(\"%s\")") % 'name', ) - def execute(self, command, criteria=None, **options): - result = list(self.obj.search(command, criteria, **options)) + def execute(self, criteria=None, **options): + result = list(self.obj.search(criteria, **options)) return dict(result=result, count=len(result), truncated=False) @@ -494,7 +494,9 @@ class BaseParamRetrieve(BaseParamMethod, BaseMetaRetrieve): class BaseParamSearch(BaseParamMethod, BaseMetaSearch): - pass + def execute(self, command, criteria=None, **options): + result = list(self.obj.search(command, criteria, **options)) + return dict(result=result, count=len(result), truncated=False) @register()