summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-12 18:32:40 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-12 18:32:40 +0200
commit7329ac9b1ebe66522ddec7f11644703e065a5056 (patch)
tree62a9cb30f77f15664130dbca36bd4c98debfd94e /pykolab
parentdc656c120b060bc8f8430a0189094a3de83b2ae7 (diff)
downloadpykolab-7329ac9b1ebe66522ddec7f11644703e065a5056.tar.gz
Make sure there is not already an LDAP instance configured.
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_ldap.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index a7cedba..be3b38a 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -69,6 +69,22 @@ def execute(*args, **kw):
if not conf.config_file == conf.defaults.config_file:
ask_questions = False
+ # Pre-execution checks
+ for path, directories, files in os.walk('/etc/dirsrv/'):
+ for direct in directories:
+ if direct.startswith('slapd-'):
+ print >> sys.stderr, utils.multiline_message(
+ _("""
+ It seems 389 Directory Server has an existing
+ instance configured. This setup script does not
+ intend to destroy or overwrite your data. Please
+ make sure /etc/dirsrv/ and /var/lib/dirsrv/ are
+ clean so that this setup does not have to worry.
+ """)
+ )
+
+ sys.exit(1)
+
_input = {}
if ask_questions: