diff options
author | Martin Basti <mbasti@redhat.com> | 2015-11-18 10:31:05 +0100 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-12-01 08:51:44 +0100 |
commit | 2a1a3c498a71e85193af76a25333ebe9011e6b2a (patch) | |
tree | 1ff5c91e164557dbc33d88599d7609d89d263dcf /ipapython | |
parent | 21f7584f9f44fdc3dee0f9d038f31edd8ee1aab2 (diff) | |
download | freeipa-2a1a3c498a71e85193af76a25333ebe9011e6b2a.tar.gz freeipa-2a1a3c498a71e85193af76a25333ebe9011e6b2a.tar.xz freeipa-2a1a3c498a71e85193af76a25333ebe9011e6b2a.zip |
Upgrade: increase time limit for upgrades
Default ldap search limit is now 30 sec by default during upgrade.
Limits must be changed for the whole ldap2 connection, because this
connection is used inside update plugins and commands called from
upgrade.
Together with increasing the time limit, also size limit should be
unlimited during upgrade. With sizelimit=None we may get the
TimeExceeded exception from getting default value of the sizelimit from LDAP.
https://fedorahosted.org/freeipa/ticket/5267
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/ipaldap.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 7e5bc04fe..bbd27ac88 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -689,6 +689,9 @@ class LDAPClient(object): 'nsslapd-minssf-exclude-rootdse': True, }) + time_limit = -1.0 # unlimited + size_limit = 0 # unlimited + def __init__(self, ldap_uri, start_tls=False, force_schema_updates=False, no_schema=False, decode_attrs=True): """Create LDAPClient object. @@ -1294,10 +1297,14 @@ class LDAPClient(object): res = [] truncated = False - if time_limit is None or time_limit == 0: + if time_limit is None: + time_limit = self.time_limit + if time_limit == 0: time_limit = -1.0 + if size_limit is None: - size_limit = 0 + size_limit = self.size_limit + if not isinstance(size_limit, int): size_limit = int(size_limit) if not isinstance(time_limit, float): |