Skip to content

Commit

Permalink
slapdtest: Automatically try some common locations for SCHEMADIR
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldap contributors authored and Petr Viktorin committed Nov 24, 2017
1 parent b2c2b5c commit 42f3e84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Lib/slapdtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ class SlapdObject(object):
TMPDIR = os.environ.get('TMP', os.getcwd())
SBINDIR = os.environ.get('SBIN', '/usr/sbin')
BINDIR = os.environ.get('BIN', '/usr/bin')
SCHEMADIR = os.environ.get('SCHEMA', '/etc/openldap/schema')
if 'SCHEMA' in os.environ:
SCHEMADIR = os.environ['SCHEMA']
elif os.path.isdir("/etc/openldap/schema"):
SCHEMADIR = "/etc/openldap/schema"
elif os.path.isdir("/etc/ldap/schema"):
SCHEMADIR = "/etc/ldap/schema"
else:
PATH_SCHEMA_CORE = None
PATH_LDAPADD = os.path.join(BINDIR, 'ldapadd')
PATH_LDAPMODIFY = os.path.join(BINDIR, 'ldapmodify')
PATH_LDAPWHOAMI = os.path.join(BINDIR, 'ldapwhoami')
Expand Down

0 comments on commit 42f3e84

Please sign in to comment.