schema: do not validate unrequested params in command_defaults

Request specific params when getting the defaults instead of getting
defaults for all params and filtering the result.

This fixes command_defaults failing with validation errors on unrequested
params.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-06 12:14:21 +02:00
parent 4660bb7ff0
commit 9c19dd3506
2 changed files with 6 additions and 5 deletions

View File

@@ -229,8 +229,7 @@ class command_defaults(PKQuery):
raise errors.ConversionError(name=name,
error=_("must be a dictionary"))
result = command.get_default(**kw)
result = {n: v for n, v in result.items() if n in params}
result = command.get_default(params, **kw)
return dict(result=result)