From ba5248135c0ca9d64deddc9d11ea1a606d87bc27 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 24 Sep 2012 16:57:13 +0300 Subject: [PATCH] Make sure external group members are listed for the external group https://fedorahosted.org/freeipa/ticket/2975 --- ipalib/plugins/group.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py index 3775056a1..f1e34bd56 100644 --- a/ipalib/plugins/group.py +++ b/ipalib/plugins/group.py @@ -162,6 +162,13 @@ class group(LDAPObject): api.register(group) +ipaexternalmember_param = Str('ipaexternalmember*', + cli_name='external', + label=_('External member'), + doc=_('comma-separated SIDs of members of a trusted domain'), + csv=True, + flags=['no_create', 'no_update', 'no_search'], + ) class group_add(LDAPCreate): __doc__ = _('Create a new group.') @@ -335,22 +342,14 @@ api.register(group_find) class group_show(LDAPRetrieve): __doc__ = _('Display information about a named group.') - + has_output_params = LDAPRetrieve.has_output_params + (ipaexternalmember_param,) api.register(group_show) class group_add_member(LDAPAddMember): __doc__ = _('Add members to a group.') - takes_options = ( - Str('ipaexternalmember*', - cli_name='external', - label=_('External member'), - doc=_('comma-separated SIDs of members of a trusted domain'), - csv=True, - flags=['no_create', 'no_update', 'no_search'], - ), - ) + takes_options = (ipaexternalmember_param,) def post_callback(self, ldap, completed, failed, dn, entry_attrs, *keys, **options): assert isinstance(dn, DN) @@ -390,15 +389,7 @@ api.register(group_add_member) class group_remove_member(LDAPRemoveMember): __doc__ = _('Remove members from a group.') - takes_options = ( - Str('ipaexternalmember*', - cli_name='external', - label=_('External member'), - doc=_('comma-separated SIDs of members of a trusted domain'), - csv=True, - flags=['no_create', 'no_update', 'no_search'], - ), - ) + takes_options = (ipaexternalmember_param,) def pre_callback(self, ldap, dn, found, not_found, *keys, **options): assert isinstance(dn, DN)