summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-09-29 19:23:35 +0200
committerMartin Kosek <mkosek@redhat.com>2014-09-30 10:42:06 +0200
commit902655da5909f79ffde6a06d527bd1dbe9ee5f8a (patch)
treea2d18fe57bca6e1a8690ba2c15a128a32752d863 /ipalib
parent47268575c931fd57298617fe979f25cb1a90d1bb (diff)
downloadfreeipa-902655da5909f79ffde6a06d527bd1dbe9ee5f8a.tar.gz
freeipa-902655da5909f79ffde6a06d527bd1dbe9ee5f8a.tar.xz
freeipa-902655da5909f79ffde6a06d527bd1dbe9ee5f8a.zip
idviews: Display the list of hosts when using --all
Enumerating hosts is a potentially expensive operation (uses paged search to list all the hosts the ID view applies to). Show the list of the hosts only if explicitly asked for (or asked for --all). Do not display with --raw, since this attribute does not exist in LDAP. Part of: https://fedorahosted.org/freeipa/ticket/3979 Reviewed-By: Petr Viktorin <pviktori@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/idviews.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ipalib/plugins/idviews.py b/ipalib/plugins/idviews.py
index 0a387b142..9c9747daf 100644
--- a/ipalib/plugins/idviews.py
+++ b/ipalib/plugins/idviews.py
@@ -205,7 +205,14 @@ class idview_show(LDAPRetrieve):
def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
self.show_id_overrides(dn, entry_attrs)
- if options.get('show_hosts', False):
+ # Enumerating hosts is a potentially expensive operation (uses paged
+ # search to list all the hosts the ID view applies to). Show the list
+ # of the hosts only if explicitly asked for (or asked for --all).
+ # Do not display with --raw, since this attribute does not exist in
+ # LDAP.
+
+ if ((options.get('show_hosts') or options.get('all'))
+ and not options.get('raw')):
self.enumerate_hosts(dn, entry_attrs)
return dn