From ff52c25ae299abba8bed653fe324951979a41293 Mon Sep 17 00:00:00 2001 From: Ana Krivokapic Date: Mon, 8 Apr 2013 11:04:17 -0400 Subject: Fix output for some CLI commands Fix output of dnsrecord_del: it now uses output.standard_delete and excludes --all and --raw flags. Fix output of sudorule_{add,remove}_option: they now use output.standard_entry and include --all and --raw flags. https://fedorahosted.org/freeipa/ticket/3503 --- ipalib/plugins/dns.py | 2 ++ ipalib/plugins/sudorule.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ipalib') diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 3e6ed835..f40360f8 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -2679,6 +2679,8 @@ api.register(dnsrecord_delentry) class dnsrecord_del(LDAPUpdate): __doc__ = _('Delete DNS resource record.') + has_output = output.standard_delete + no_option_msg = _('Neither --del-all nor options to delete a specific record provided.\n'\ "Command help may be consulted for all supported record types.") diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py index 3c89b7a0..a89941cb 100644 --- a/ipalib/plugins/sudorule.py +++ b/ipalib/plugins/sudorule.py @@ -605,6 +605,7 @@ api.register(sudorule_remove_runasgroup) class sudorule_add_option(LDAPQuery): __doc__ = _('Add an option to the Sudo Rule.') + has_output = output.standard_entry takes_options = ( Str('ipasudoopt', cli_name='sudooption', @@ -642,7 +643,7 @@ class sudorule_add_option(LDAPQuery): entry_attrs = entry_to_dict(entry_attrs, **options) - return dict(result=entry_attrs) + return dict(result=entry_attrs, value=cn) def output_for_cli(self, textui, result, cn, **options): textui.print_dashed(_('Added option "%(option)s" to Sudo Rule "%(rule)s"') % \ @@ -657,6 +658,7 @@ api.register(sudorule_add_option) class sudorule_remove_option(LDAPQuery): __doc__ = _('Remove an option from Sudo Rule.') + has_output = output.standard_entry takes_options = ( Str('ipasudoopt', cli_name='sudooption', @@ -697,7 +699,7 @@ class sudorule_remove_option(LDAPQuery): entry_attrs = entry_to_dict(entry_attrs, **options) - return dict(result=entry_attrs) + return dict(result=entry_attrs, value=cn) def output_for_cli(self, textui, result, cn, **options): textui.print_dashed(_('Removed option "%(option)s" from Sudo Rule "%(rule)s"') % \ -- cgit