diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2016-07-18 13:18:44 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-07-20 13:57:01 +0200 |
commit | f0a61546f552d4df887617167f7dc1378cb95083 (patch) | |
tree | e41f1d0bca4d0859ce1fcde1ea1854c89ead0ec1 /ipalib/output.py | |
parent | 90704df59dbe996ef1db58d7a11f826c008d08a3 (diff) | |
download | freeipa-f0a61546f552d4df887617167f7dc1378cb95083.tar.gz freeipa-f0a61546f552d4df887617167f7dc1378cb95083.tar.xz freeipa-f0a61546f552d4df887617167f7dc1378cb95083.zip |
allow 'value' output param in commands without primary key
`PrimaryKey` output param works only for API objects that have primary keys,
otherwise it expects None (nothing is associated with this param). Since the
validation of command output was tightened durng thin client effort, some
commands not honoring this contract began to fail output validation.
A custom output was implemented for them to restore their functionality. It
should however be considered as a fix for broken commands and not used
further.
https://fedorahosted.org/freeipa/ticket/6037
https://fedorahosted.org/freeipa/ticket/6061
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib/output.py')
-rw-r--r-- | ipalib/output.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ipalib/output.py b/ipalib/output.py index 19dd9adad..b10458463 100644 --- a/ipalib/output.py +++ b/ipalib/output.py @@ -217,3 +217,13 @@ simple_value = ( Output('result', bool, _('True means the operation was successful')), Output('value', unicode, flags=['no_display']), ) + +# custom shim for commands like `trustconfig-show`, +# `automember-default-group-*` which put stuff into output['value'] despite not +# having primary key themselves. Designing commands like this is not a very +# good practice, so please do not use this for new code. +simple_entry = ( + summary, + Entry('result'), + Output('value', unicode, flags=['no_display']), +) |