From 448af06234030d171cd0cee654f970456d53e9e6 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Jun 15 2016 12:03:51 +0000 Subject: dns, passwd: fix outputs of `dns_resolve` and `passwd` commands Use proper output type for the `value` output of the commands. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka --- diff --git a/API.txt b/API.txt index e7c36c8..93b009b 100644 --- a/API.txt +++ b/API.txt @@ -1053,7 +1053,7 @@ arg: Str('hostname') option: Str('version?') output: Output('result', type=[]) output: Output('summary', type=[, ]) -output: PrimaryKey('value') +output: Output('value', type=[]) command: dnsconfig_mod args: 0,11,3 option: Str('addattr*', cli_name='addattr') @@ -3317,7 +3317,7 @@ option: Password('otp?', confirm=False) option: Str('version?') output: Output('result', type=[]) output: Output('summary', type=[, ]) -output: PrimaryKey('value') +output: Output('value', type=[]) command: permission_add args: 1,21,3 arg: Str('cn', cli_name='name') diff --git a/ipalib/output.py b/ipalib/output.py index d884112..19dd9ad 100644 --- a/ipalib/output.py +++ b/ipalib/output.py @@ -211,3 +211,9 @@ standard_boolean = ( ) standard_value = standard_boolean + +simple_value = ( + summary, + Output('result', bool, _('True means the operation was successful')), + Output('value', unicode, flags=['no_display']), +) diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py index db17907..5df363c 100644 --- a/ipaserver/plugins/dns.py +++ b/ipaserver/plugins/dns.py @@ -3965,7 +3965,7 @@ class dns_resolve(Command): NO_CLI = True - has_output = output.standard_value + has_output = output.simple_value msg_summary = _('Found \'%(value)s\'') takes_args = ( diff --git a/ipaserver/plugins/passwd.py b/ipaserver/plugins/passwd.py index c4e2208..8f6b80d 100644 --- a/ipaserver/plugins/passwd.py +++ b/ipaserver/plugins/passwd.py @@ -97,7 +97,7 @@ class passwd(Command): ), ) - has_output = output.standard_value + has_output = output.simple_value msg_summary = _('Changed password for "%(value)s"') def execute(self, principal, password, current_password, **options):