summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-09-05 17:53:29 +0200
committerMartin Kosek <mkosek@redhat.com>2012-09-07 16:52:39 +0200
commitee199fe05160e41c01fa5b9e0f9262ad216e084c (patch)
tree0ca74f867b15f8b360f30746a44372066d7d678f
parentef14704e1e22c0998c7c3ab3ac4ab0d32228e74b (diff)
downloadfreeipa.git-ee199fe05160e41c01fa5b9e0f9262ad216e084c.tar.gz
freeipa.git-ee199fe05160e41c01fa5b9e0f9262ad216e084c.tar.xz
freeipa.git-ee199fe05160e41c01fa5b9e0f9262ad216e084c.zip
Trust CLI: Return more details when searching trusts
Fixes https://fedorahosted.org/freeipa/ticket/2970
-rw-r--r--ipalib/plugins/trust.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
index 67f47932..b2f3e559 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