diff options
author | Sumit Bose <sbose@redhat.com> | 2012-09-05 17:53:29 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-09-07 16:50:35 +0200 |
commit | 94ce8ecb9c4b396d06f6873d6d93432d73d34f4b (patch) | |
tree | 0ca74f867b15f8b360f30746a44372066d7d678f /ipalib | |
parent | e23acda5b816befab48bc46ec8f03ba7a0af9ae2 (diff) | |
download | freeipa-94ce8ecb9c4b396d06f6873d6d93432d73d34f4b.tar.gz freeipa-94ce8ecb9c4b396d06f6873d6d93432d73d34f4b.tar.xz freeipa-94ce8ecb9c4b396d06f6873d6d93432d73d34f4b.zip |
Trust CLI: Return more details when searching trusts
Fixes https://fedorahosted.org/freeipa/ticket/2970
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/trust.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py index 67f479323..b2f3e5597 100644 --- a/ipalib/plugins/trust.py +++ b/ipalib/plugins/trust.py @@ -100,6 +100,8 @@ class trust(LDAPObject): 'ipanttrusttype', 'ipanttrustattributes', 'ipanttrustdirection', 'ipanttrustpartner', 'ipantauthtrustoutgoing', 'ipanttrustauthincoming', 'ipanttrustforesttrustinfo', 'ipanttrustposixoffset', 'ipantsupportedencryptiontypes' ] + search_display_attributes = ['cn', 'ipantflatname', + 'ipanttrusteddomainsid', 'ipanttrusttype' ] label = _('Trusts') label_singular = _('Trust') @@ -300,6 +302,7 @@ class trust_mod(LDAPUpdate): class trust_find(LDAPSearch): __doc__ = _('Search for trusts.') + has_output_params = LDAPSearch.has_output_params + trust_output_params msg_summary = ngettext( '%(count)d trust matched', '%(count)d trusts matched', 0 @@ -311,6 +314,16 @@ class trust_find(LDAPSearch): assert isinstance(base_dn, DN) return (filters, base_dn, ldap.SCOPE_SUBTREE) + def post_callback(self, ldap, entries, truncated, *args, **options): + if options.get('pkey_only', False): + return truncated + + for entry in entries: + (dn, attrs) = entry + attrs['trusttype'] = trust_type_string(attrs['ipanttrusttype'][0]) + + return truncated + class trust_show(LDAPRetrieve): __doc__ = _('Display information about a trust.') has_output_params = LDAPRetrieve.has_output_params + trust_output_params |