From 6511f2a8343ca0cef863d12cec59ecc1a8cfa08e Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Mon, 20 Feb 2017 22:34:13 -0500 Subject: [PATCH] Detect kerberos.schema on RHEL The docpath on RHEL includes the package version. Since there will only ever be one version, just glob it. Signed-off-by: Robbie Harwood Reviewed-by: Simo Sorce (cherry picked from commit 57e8fb3ac1be3ed648629066509b832fb8231554) --- proxy/tests/testlib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/tests/testlib.py b/proxy/tests/testlib.py index 858e9a9..bb210d3 100755 --- a/proxy/tests/testlib.py +++ b/proxy/tests/testlib.py @@ -148,10 +148,11 @@ def setup_ldap(testdir, wrapenv): raise ValueError("Did not find LDAP schemas; is openldap installed?") k5schema = None - for path in ["/usr/share/doc/krb5-server-ldap/kerberos.schema", + for path in ["/usr/share/doc/krb5-server-ldap*/kerberos.schema", "/usr/share/doc/krb5-kdc-ldap/kerberos.schema.gz"]: - if os.path.exists(path): - k5schema = path + pathlist = glob.glob(path) + if len(pathlist) > 0: + k5schema = pathlist[0] break if k5schema == None: print("Please be sure krb5 ldap packages are installed")