diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-06-03 07:31:38 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-06-15 14:03:51 +0200 |
commit | e2a8290af1848ae22db27bcde8a9dc25572a1a43 (patch) | |
tree | be6048ab8d9280b5dc483a0e4c652b35cf2a6dd4 /ipaserver/plugins/schema.py | |
parent | 3ac2215ddb9452e7ebeee43a5eaadcd589c94530 (diff) | |
download | freeipa-e2a8290af1848ae22db27bcde8a9dc25572a1a43.tar.gz freeipa-e2a8290af1848ae22db27bcde8a9dc25572a1a43.tar.xz freeipa-e2a8290af1848ae22db27bcde8a9dc25572a1a43.zip |
batch, schema: use Dict instead of Any
Add new Dict parameter class and use it in the batch and command_defaults
plugins.
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/plugins/schema.py')
-rw-r--r-- | ipaserver/plugins/schema.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ipaserver/plugins/schema.py b/ipaserver/plugins/schema.py index 80c485dfd..ae233d205 100644 --- a/ipaserver/plugins/schema.py +++ b/ipaserver/plugins/schema.py @@ -12,7 +12,7 @@ from ipalib import errors from ipalib.crud import PKQuery, Retrieve, Search from ipalib.frontend import Command, Method, Object from ipalib.output import Entry, ListOfEntries, ListOfPrimaryKeys, PrimaryKey -from ipalib.parameters import Any, Bool, Flag, Int, Str +from ipalib.parameters import Bool, Dict, Flag, Int, Str from ipalib.plugable import Registry from ipalib.text import _ from ipapython.version import API_VERSION @@ -216,18 +216,14 @@ class command_defaults(PKQuery): takes_options = ( Str('params*'), - Any('kw?'), + Dict('kw?'), ) def execute(self, name, **options): command = self.api.Command[name] params = options.get('params', []) - kw = options.get('kw', {}) - if not isinstance(kw, dict): - raise errors.ConversionError(name=name, - error=_("must be a dictionary")) result = command.get_default(params, **kw) |