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/batch.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/batch.py')
| -rw-r--r-- | ipaserver/plugins/batch.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ipaserver/plugins/batch.py b/ipaserver/plugins/batch.py index aebdc2f72..aa4ace918 100644 --- a/ipaserver/plugins/batch.py +++ b/ipaserver/plugins/batch.py @@ -49,7 +49,7 @@ import six from ipalib import api, errors from ipalib import Command -from ipalib.parameters import Str, Any +from ipalib.parameters import Str, Dict from ipalib.output import Output from ipalib.text import _ from ipalib.request import context @@ -66,7 +66,7 @@ class batch(Command): NO_CLI = True takes_args = ( - Any('methods*', + Dict('methods*', doc=_('Nested Methods to execute'), ), ) @@ -90,12 +90,6 @@ class batch(Command): def execute(self, methods=None, **options): results = [] for arg in (methods or []): - # As take_args = Any, no check is done before - # Need to make sure that methods contain dict objects - if not isinstance(arg, dict): - raise errors.ConversionError( - name='methods', - error=_(u'must contain dict objects')) params = dict() name = None try: |
