diff options
| author | Martin Basti <mbasti@redhat.com> | 2016-04-08 16:18:08 +0200 |
|---|---|---|
| committer | Martin Basti <mbasti@redhat.com> | 2016-04-22 13:28:57 +0200 |
| commit | fe2ce02a6f7664e377c367e16e9c2e1ad960c9d7 (patch) | |
| tree | b33ddc969e00ad6565b982bec11eba392e8ab4ff | |
| parent | dbc3a7511029dd954fff4cdb722f51e1f4e4b054 (diff) | |
| download | freeipa-fe2ce02a6f7664e377c367e16e9c2e1ad960c9d7.tar.gz freeipa-fe2ce02a6f7664e377c367e16e9c2e1ad960c9d7.tar.xz freeipa-fe2ce02a6f7664e377c367e16e9c2e1ad960c9d7.zip | |
Performace: don't download password attributes in host/user-find
For each entry in user/host-find was executed an extra search for password
attributes what has significant impact on performance (for 2000 users
there were 2000 additional searches)
http://www.freeipa.org/page/V4/Performance_Improvements
https://fedorahosted.org/freeipa/ticket/5281
Reviewed-By: David Kupka <dkupka@redhat.com>
| -rw-r--r-- | ipalib/plugins/baseuser.py | 1 | ||||
| -rw-r--r-- | ipalib/plugins/host.py | 5 | ||||
| -rw-r--r-- | ipatests/test_xmlrpc/test_host_plugin.py | 2 | ||||
| -rw-r--r-- | ipatests/test_xmlrpc/tracker/host_plugin.py | 6 | ||||
| -rw-r--r-- | ipatests/test_xmlrpc/tracker/user_plugin.py | 8 |
5 files changed, 11 insertions, 11 deletions
diff --git a/ipalib/plugins/baseuser.py b/ipalib/plugins/baseuser.py index 9c78a521d..af81b9373 100644 --- a/ipalib/plugins/baseuser.py +++ b/ipalib/plugins/baseuser.py @@ -617,7 +617,6 @@ class baseuser_find(LDAPSearch): def post_common_callback(self, ldap, entries, lockout=False, **options): for attrs in entries: - self.obj.get_password_attributes(ldap, attrs.dn, attrs) self.obj.convert_usercertificate_post(attrs, **options) if (lockout): attrs['nsaccountlock'] = True diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index 04bb2991a..1e8b2b6ca 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -1024,12 +1024,7 @@ class host_find(LDAPSearch): set_certificate_attrs(entry_attrs) set_kerberos_attrs(entry_attrs, options) rename_ipaallowedtoperform_from_ldap(entry_attrs, options) - self.obj.get_password_attributes(ldap, entry_attrs.dn, entry_attrs) self.obj.suppress_netgroup_memberof(ldap, entry_attrs) - if entry_attrs['has_password']: - # If an OTP is set there is no keytab, at least not one - # fetched anywhere. - entry_attrs['has_keytab'] = False if options.get('all', False): entry_attrs['managing'] = self.obj.get_managed_hosts(entry_attrs.dn) diff --git a/ipatests/test_xmlrpc/test_host_plugin.py b/ipatests/test_xmlrpc/test_host_plugin.py index 47f05a403..ea8f49656 100644 --- a/ipatests/test_xmlrpc/test_host_plugin.py +++ b/ipatests/test_xmlrpc/test_host_plugin.py @@ -416,7 +416,7 @@ class TestManagedHosts(XMLRPC_test): count=1, truncated=False, summary=u'1 host matched', - result=[host.filter_attrs(host.retrieve_keys)], + result=[host.filter_attrs(host.find_keys)], ), result) def search_man_hosts(self, host1, host2): diff --git a/ipatests/test_xmlrpc/tracker/host_plugin.py b/ipatests/test_xmlrpc/tracker/host_plugin.py index 0a69d39c0..67faa1acf 100644 --- a/ipatests/test_xmlrpc/tracker/host_plugin.py +++ b/ipatests/test_xmlrpc/tracker/host_plugin.py @@ -42,6 +42,8 @@ class HostTracker(Tracker): update_keys = retrieve_keys - {'dn'} managedby_keys = retrieve_keys - {'has_keytab', 'has_password'} allowedto_keys = retrieve_keys - {'has_keytab', 'has_password'} + find_keys = retrieve_keys - {'has_keytab', 'has_password'} + find_all_keys = retrieve_all_keys - {'has_keytab', 'has_password'} def __init__(self, name, fqdn=None, default_version=None): super(HostTracker, self).__init__(default_version=default_version) @@ -136,9 +138,9 @@ class HostTracker(Tracker): def check_find(self, result, all=False, raw=False): """Check `host_find` command result""" if all: - expected = self.filter_attrs(self.retrieve_all_keys) + expected = self.filter_attrs(self.find_all_keys) else: - expected = self.filter_attrs(self.retrieve_keys) + expected = self.filter_attrs(self.find_keys) assert_deepequal(dict( count=1, truncated=False, diff --git a/ipatests/test_xmlrpc/tracker/user_plugin.py b/ipatests/test_xmlrpc/tracker/user_plugin.py index 216112db5..5acfc63cd 100644 --- a/ipatests/test_xmlrpc/tracker/user_plugin.py +++ b/ipatests/test_xmlrpc/tracker/user_plugin.py @@ -51,8 +51,12 @@ class UserTracker(Tracker): update_keys = retrieve_keys - {u'dn'} activate_keys = retrieve_keys - find_keys = retrieve_keys - {u'mepmanagedentry', u'memberof_group'} - find_all_keys = retrieve_all_keys + find_keys = retrieve_keys - { + u'mepmanagedentry', u'memberof_group', u'has_keytab', u'has_password' + } + find_all_keys = retrieve_all_keys - { + u'has_keytab', u'has_password' + } primary_keys = {u'uid', u'dn'} |
