[29223] in CVS-changelog-for-Kerberos-V5
krb5 commit: Search for LDAP core schema in t_kdb.py
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Dec 23 12:54:33 2015
Date: Wed, 23 Dec 2015 12:54:30 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201512231754.tBNHsUUI025797@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/c5069d75793e360463ecbd14e6593e245a7151b6
commit c5069d75793e360463ecbd14e6593e245a7151b6
Author: Sarah Day <sarahday@mit.edu>
Date: Fri Dec 4 12:36:33 2015 -0500
Search for LDAP core schema in t_kdb.py
The t_kdb.py python test was hardcoded to search for the LDAP
core.schema file in a single place. OpenLDAP can be installed in more
than one place. Add a check which looks in several of these common
installation locations to find the core schema file.
src/tests/t_kdb.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/tests/t_kdb.py b/src/tests/t_kdb.py
index 28c672c..2d2d675 100755
--- a/src/tests/t_kdb.py
+++ b/src/tests/t_kdb.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
from k5test import *
import time
+from itertools import imap
# Run kdbtest against the BDB module.
realm = K5Realm(create_kdb=False)
@@ -41,9 +42,11 @@ os.mkdir(dbdir)
shutil.copy(system_slapd, slapd)
# Find the core schema file if we can.
-core_schema = None
-if os.path.isfile('/etc/ldap/schema/core.schema'):
- core_schema = '/etc/ldap/schema/core.schema'
+ldap_homes = ['/etc/ldap', '/etc/openldap', '/usr/local/etc/openldap',
+ '/usr/local/etc/ldap']
+local_schema_path = '/schema/core.schema'
+core_schema = next((i for i in imap(lambda x:x+local_schema_path, ldap_homes)
+ if os.path.isfile(i)), None)
# Make a slapd config file. This is deprecated in OpenLDAP 2.3 and
# later, but it's easier than using LDIF and slapadd. Include some
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5