Univention Bugzilla – Attachment 11233 Details for
Bug 57574
univention.uldap should not load UCR (again) on module import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
57267.patch
57267.patch (text/plain), 4.17 KB, created by
Arvid Requate
on 2024-09-09 16:18:02 CEST
(
hide
)
Description:
57267.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2024-09-09 16:18:02 CEST
Size:
4.17 KB
patch
obsolete
>commit d29dd08771dd2c40abe8f9bc94996c08141a4121 >Author: Florian Best <best@univention.de> >Date: Mon Sep 9 13:49:22 2024 +0200 > > fixup! Bug #57267: Feature flag: prepostread > >diff --git base/univention-python/modules/uldap.py base/univention-python/modules/uldap.py >index a2214ccb092..e2e54559f86 100644 >--- base/univention-python/modules/uldap.py >+++ base/univention-python/modules/uldap.py >@@ -46,13 +46,9 @@ from ldap.controls.readentry import PostReadControl, PreReadControl > from ldapurl import LDAPUrl, isLDAPUrl > > import univention.logging # noqa: F401 >-from univention.config_registry import ConfigRegistry >+from univention.config_registry import ucr > > >-configRegistry = ConfigRegistry() >-configRegistry.load() >-feature_full_prepostread = configRegistry.is_true('directory/manager/feature/prepostread', False) >- > try: > from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union # noqa: F401 > except ImportError: >@@ -102,8 +98,6 @@ def getRootDnConnection(start_tls=None, decode_ignorelist=[], reconnect=True): > :return: A LDAP access object. > :rtype: univention.uldap.access > """ >- ucr = ConfigRegistry() >- ucr.load() > port = int(ucr.get('slapd/port', '7389').split(',')[0]) > host = ucr['hostname'] + '.' + ucr['domainname'] > if ucr.get('ldap/server/type', 'dummy') == 'master': >@@ -127,8 +121,6 @@ def getAdminConnection(start_tls=None, decode_ignorelist=[], reconnect=True): > :return: A LDAP access object. > :rtype: univention.uldap.access > """ >- ucr = ConfigRegistry() >- ucr.load() > bindpw = open('/etc/ldap.secret').read().rstrip('\n') > port = int(ucr.get('ldap/master/port', '7389')) > return access(host=ucr['ldap/master'], port=port, base=ucr['ldap/base'], binddn='cn=admin,' + ucr['ldap/base'], bindpw=bindpw, start_tls=start_tls, decode_ignorelist=decode_ignorelist, reconnect=reconnect) >@@ -146,8 +138,6 @@ def getBackupConnection(start_tls=None, decode_ignorelist=[], reconnect=True): > :return: A LDAP access object. > :rtype: univention.uldap.access > """ >- ucr = ConfigRegistry() >- ucr.load() > bindpw = open('/etc/ldap-backup.secret').read().rstrip('\n') > port = int(ucr.get('ldap/master/port', '7389')) > try: >@@ -174,9 +164,6 @@ def getMachineConnection(start_tls=None, decode_ignorelist=[], ldap_master=True, > :return: A LDAP access object. > :rtype: univention.uldap.access > """ >- ucr = ConfigRegistry() >- ucr.load() >- > bindpw = open(secret_file).read().rstrip('\n') > > if ldap_master: >@@ -264,9 +251,6 @@ class access(object): > > self.port = int(port) if port else None > >- ucr = ConfigRegistry() >- ucr.load() >- > if self.start_tls is None: > self.start_tls = ucr.get_int('directory/manager/starttls', 2) > >@@ -719,7 +703,7 @@ class access(object): > """ > log.debug('uldap.add dn=%s', dn) > >- if feature_full_prepostread: >+ if ucr.is_true('directory/manager/feature/prepostread', False): > if serverctrls: > for ctrl in serverctrls: > if isinstance(ctrl, PostReadControl): >@@ -769,7 +753,7 @@ class access(object): > """ > log.debug('uldap.modify %s', dn) > >- if feature_full_prepostread: >+ if ucr.is_true('directory/manager/feature/prepostread', False): > if serverctrls: > for ctrl in serverctrls: > for ctrl_type in (PreReadControl, PostReadControl): >@@ -898,7 +882,7 @@ class access(object): > newrdn = ldap.dn.dn2str([ldap.dn.str2dn(newdn)[0]]) > newsdn = ldap.dn.dn2str(ldap.dn.str2dn(newdn)[1:]) > >- if feature_full_prepostread: >+ if ucr.is_true('directory/manager/feature/prepostread', False): > if serverctrls: > for ctrl in serverctrls: > for ctrl_type in (PreReadControl, PostReadControl): >@@ -957,7 +941,7 @@ class access(object): > """ > log.debug('uldap.delete %s', dn) > >- if feature_full_prepostread: >+ if ucr.is_true('directory/manager/feature/prepostread', False): > if serverctrls: > for ctrl in serverctrls: > if isinstance(ctrl, PreReadControl):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57574
: 11233