Replace the 'private' option in netgroup-find with 'managed'.

The 'private' option is kept in to maintain API compatibility, but
is hidden from the user.

ticket 1120
This commit is contained in:
Jan Cholasta 2011-06-28 16:06:11 +02:00 committed by Rob Crittenden
parent f05141e646
commit 67b807d640
3 changed files with 13 additions and 7 deletions

View File

@ -1579,7 +1579,7 @@ output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly
output: Output('result', <type 'dict'>, 'list of deletions that failed')
output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user")
command: netgroup_find
args: 1,24,4
args: 1,25,4
arg: Str('criteria?')
option: Str('cn', attribute=True, autofill=False, cli_name='name', label=Gettext('Netgroup name', domain='ipa', localedir=None), multivalue=False, normalizer=<lambda>, primary_key=True, query=True, required=False)
option: Str('description', attribute=True, autofill=False, cli_name='desc', label=Gettext('Description', domain='ipa', localedir=None), multivalue=False, query=True, required=False)
@ -1589,7 +1589,8 @@ option: StrEnum('usercategory', attribute=True, autofill=False, cli_name='userca
option: StrEnum('hostcategory', attribute=True, autofill=False, cli_name='hostcat', label=Gettext('Host category', domain='ipa', localedir=None), multivalue=False, query=True, required=False, values=(u'all',))
option: Int('timelimit?', autofill=False, flags=['no_display'], label=Gettext('Time Limit', domain='ipa', localedir=None), minvalue=0)
option: Int('sizelimit?', autofill=False, flags=['no_display'], label=Gettext('Size Limit', domain='ipa', localedir=None), minvalue=0)
option: Flag('private', autofill=True, cli_name='private', default=False)
option: Flag('private', autofill=True, default=False, exclude='webui', flags=['no_option', 'no_output'])
option: Flag('managed', autofill=True, cli_name='managed', default=False, default_from=<lambda>)
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])

View File

@ -79,4 +79,4 @@ IPA_DATA_VERSION=20100614120000
# #
########################################################
IPA_API_VERSION_MAJOR=2
IPA_API_VERSION_MINOR=6
IPA_API_VERSION_MINOR=7

View File

@ -189,18 +189,23 @@ class netgroup_find(LDAPSearch):
takes_options = LDAPSearch.takes_options + (
Flag('private',
cli_name='private',
doc=_('search for private groups'),
exclude='webui',
flags=['no_option', 'no_output'],
),
Flag('managed',
cli_name='managed',
doc=_('search for managed groups'),
default_from=lambda private: private,
),
)
def pre_callback(self, ldap, filter, attrs_list, base_dn, scope, *args, **options):
# Do not display private mepManagedEntry netgroups by default
# If looking for private groups, we need to omit the negation search filter
# If looking for managed groups, we need to omit the negation search filter
search_kw = {}
search_kw['objectclass'] = ['mepManagedEntry']
if not options['private']:
if not options['managed']:
local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE)
else:
local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_ALL)