mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
parent
b25080bbca
commit
ff52c25ae2
22
API.txt
22
API.txt
@ -806,13 +806,12 @@ output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDA
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
output: Output('value', <type 'unicode'>, None)
|
||||
command: dnsrecord_del
|
||||
args: 2,41,3
|
||||
args: 2,39,3
|
||||
arg: Str('dnszoneidnsname', cli_name='dnszone', query=True, required=True)
|
||||
arg: Str('idnsname', attribute=True, cli_name='name', multivalue=False, primary_key=True, query=True, required=True)
|
||||
option: A6Record('a6record', attribute=True, autofill=False, cli_name='a6_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: AAAARecord('aaaarecord', attribute=True, autofill=False, cli_name='aaaa_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: AFSDBRecord('afsdbrecord', attribute=True, autofill=False, cli_name='afsdb_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
|
||||
option: APLRecord('aplrecord', attribute=True, autofill=False, cli_name='apl_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: ARecord('arecord', attribute=True, autofill=False, cli_name='a_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: CERTRecord('certrecord', attribute=True, autofill=False, cli_name='cert_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
@ -837,7 +836,6 @@ option: NSEC3Record('nsec3record', attribute=True, autofill=False, cli_name='nse
|
||||
option: NSECRecord('nsecrecord', attribute=True, autofill=False, cli_name='nsec_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: NSRecord('nsrecord', attribute=True, autofill=False, cli_name='ns_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: PTRRecord('ptrrecord', attribute=True, autofill=False, cli_name='ptr_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
|
||||
option: RPRecord('rprecord', attribute=True, autofill=False, cli_name='rp_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: RRSIGRecord('rrsigrecord', attribute=True, autofill=False, cli_name='rrsig_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: SIGRecord('sigrecord', attribute=True, autofill=False, cli_name='sig_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
@ -850,7 +848,7 @@ option: TKEYRecord('tkeyrecord', attribute=True, autofill=False, cli_name='tkey_
|
||||
option: TSIGRecord('tsigrecord', attribute=True, autofill=False, cli_name='tsig_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: TXTRecord('txtrecord', attribute=True, autofill=False, cli_name='txt_rec', csv=True, multivalue=True, option_group=None, required=False)
|
||||
option: Str('version?', exclude='webui')
|
||||
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
|
||||
output: Output('result', <type 'dict'>, None)
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
output: Output('value', <type 'unicode'>, None)
|
||||
command: dnsrecord_delentry
|
||||
@ -3137,11 +3135,15 @@ output: Output('completed', <type 'int'>, None)
|
||||
output: Output('failed', <type 'dict'>, None)
|
||||
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
|
||||
command: sudorule_add_option
|
||||
args: 1,2,1
|
||||
args: 1,4,3
|
||||
arg: Str('cn', attribute=True, cli_name='sudorule_name', multivalue=False, primary_key=True, query=True, required=True)
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
|
||||
option: Str('ipasudoopt', cli_name='sudooption')
|
||||
option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
|
||||
option: Str('version?', exclude='webui')
|
||||
output: Output('result', None, None)
|
||||
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
output: Output('value', <type 'unicode'>, None)
|
||||
command: sudorule_add_runasgroup
|
||||
args: 1,4,3
|
||||
arg: Str('cn', attribute=True, cli_name='sudorule_name', multivalue=False, primary_key=True, query=True, required=True)
|
||||
@ -3277,11 +3279,15 @@ output: Output('completed', <type 'int'>, None)
|
||||
output: Output('failed', <type 'dict'>, None)
|
||||
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
|
||||
command: sudorule_remove_option
|
||||
args: 1,2,1
|
||||
args: 1,4,3
|
||||
arg: Str('cn', attribute=True, cli_name='sudorule_name', multivalue=False, primary_key=True, query=True, required=True)
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
|
||||
option: Str('ipasudoopt', cli_name='sudooption')
|
||||
option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
|
||||
option: Str('version?', exclude='webui')
|
||||
output: Output('result', None, None)
|
||||
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
output: Output('value', <type 'unicode'>, None)
|
||||
command: sudorule_remove_runasgroup
|
||||
args: 1,4,3
|
||||
arg: Str('cn', attribute=True, cli_name='sudorule_name', multivalue=False, primary_key=True, query=True, required=True)
|
||||
|
2
VERSION
2
VERSION
@ -89,4 +89,4 @@ IPA_DATA_VERSION=20100614120000
|
||||
# #
|
||||
########################################################
|
||||
IPA_API_VERSION_MAJOR=2
|
||||
IPA_API_VERSION_MINOR=55
|
||||
IPA_API_VERSION_MINOR=56
|
||||
|
@ -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.")
|
||||
|
||||
|
@ -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"') % \
|
||||
|
@ -147,8 +147,6 @@ class TestCLIParsing(object):
|
||||
idnsname=u'ns',
|
||||
del_all=True,
|
||||
structured=False,
|
||||
raw=False,
|
||||
all=False,
|
||||
version=API_VERSION)
|
||||
with self.fake_stdin('YeS\n'):
|
||||
self.check_command('dnsrecord_del test-example.com ns',
|
||||
@ -157,8 +155,6 @@ class TestCLIParsing(object):
|
||||
idnsname=u'ns',
|
||||
del_all=True,
|
||||
structured=False,
|
||||
raw=False,
|
||||
all=False,
|
||||
version=API_VERSION)
|
||||
finally:
|
||||
self.run_command('dnszone_del', idnsname=u'test-example.com')
|
||||
@ -184,8 +180,6 @@ class TestCLIParsing(object):
|
||||
del_all=False,
|
||||
sshfprecord=records,
|
||||
structured=False,
|
||||
raw=False,
|
||||
all=False,
|
||||
version=API_VERSION)
|
||||
finally:
|
||||
self.run_command('dnszone_del', idnsname=u'test-example.com')
|
||||
@ -261,8 +255,6 @@ class TestCLIParsing(object):
|
||||
del_all=False,
|
||||
txtrecord=[u'"A pretty little problem," said Holmes.'],
|
||||
structured=False,
|
||||
raw=False,
|
||||
all=False,
|
||||
version=API_VERSION)
|
||||
finally:
|
||||
self.run_command('dnszone_del', idnsname=u'test-example.com')
|
||||
|
Loading…
Reference in New Issue
Block a user