diff options
-rw-r--r-- | ipalib/plugins/aci.py | 2 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_delegation_plugin.py | 40 |
2 files changed, 41 insertions, 1 deletions
diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py index 7d5bf504..702ae010 100644 --- a/ipalib/plugins/aci.py +++ b/ipalib/plugins/aci.py @@ -801,7 +801,7 @@ class aci_find(crud.Search): groupdn = a.bindrule['expression'] groupdn = DN(groupdn.replace('ldap:///','')) try: - cn = groupdn[0]['cn'].value + cn = groupdn[0]['cn'] except (IndexError, KeyError): cn = None if cn is None or cn != kw['group']: diff --git a/tests/test_xmlrpc/test_delegation_plugin.py b/tests/test_xmlrpc/test_delegation_plugin.py index a31fed3e..bc3b96a2 100644 --- a/tests/test_xmlrpc/test_delegation_plugin.py +++ b/tests/test_xmlrpc/test_delegation_plugin.py @@ -178,6 +178,46 @@ class test_delegation(Declarative): dict( + desc='Search for %r using --group filter' % delegation1, + command=('delegation_find', [delegation1], {'group': u'editors'}), + expected=dict( + count=1, + truncated=False, + summary=u'1 delegation matched', + result=[ + { + 'attrs': [u'street', u'c', u'l', u'st', u'postalcode'], + 'permissions': [u'write'], + 'aciname': delegation1, + 'group': u'editors', + 'memberof': member1, + }, + ], + ), + ), + + + dict( + desc='Search for %r using --membergroup filter' % delegation1, + command=('delegation_find', [delegation1], {'memberof': member1}), + expected=dict( + count=1, + truncated=False, + summary=u'1 delegation matched', + result=[ + { + 'attrs': [u'street', u'c', u'l', u'st', u'postalcode'], + 'permissions': [u'write'], + 'aciname': delegation1, + 'group': u'editors', + 'memberof': member1, + }, + ], + ), + ), + + + dict( desc='Search for %r with --pkey-only' % delegation1, command=('delegation_find', [delegation1], {'pkey_only' : True}), expected=dict( |