summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-10-30 14:54:21 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-11-02 16:36:55 +1100
commitaa37db5a12fcd8f9d9cba56378953f1c16de6d46 (patch)
tree345c2ddb9ff1097d637f705e98e9b0e0e80bda0c
parente94bfe5efbbc61eea8592adce55a998aa6f400d8 (diff)
downloadsamba-aa37db5a12fcd8f9d9cba56378953f1c16de6d46.tar.gz
samba-aa37db5a12fcd8f9d9cba56378953f1c16de6d46.tar.bz2
samba-aa37db5a12fcd8f9d9cba56378953f1c16de6d46.zip
s4:provision Inline 'ldap_backend_shutdown' for clarity
-rw-r--r--source4/scripting/python/samba/provision.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index f570599e62..7236667755 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1450,21 +1450,6 @@ def setup_db_config(setup_path, dbdir):
setup_file(setup_path("DB_CONFIG"), os.path.join(dbdir, "DB_CONFIG"),
{"LDAPDBDIR": dbdir})
-def ldap_backend_shutdown(self):
- # if an LDAP backend is in use, terminate slapd after final provision and check its proper termination
- if self.slapd.poll() is None:
- #Kill the slapd
- if hasattr(self.slapd, "terminate"):
- self.slapd.terminate()
- else:
- # Older python versions don't have .terminate()
- import signal
- os.kill(self.slapd.pid, signal.SIGTERM)
-
- #and now wait for it to die
- self.slapd.communicate()
-
-
class ProvisionBackend(object):
def __init__(self, backend_type, paths=None, setup_path=None, lp=None, credentials=None,
names=None, message=None,
@@ -1563,6 +1548,21 @@ class ProvisionBackend(object):
#Kerberos to an ldapi:// backend makes no sense
self.secrets_credentials.set_kerberos_state(DONT_USE_KERBEROS)
+
+ def ldap_backend_shutdown(self):
+ # if an LDAP backend is in use, terminate slapd after final provision and check its proper termination
+ if self.slapd.poll() is None:
+ #Kill the slapd
+ if hasattr(self.slapd, "terminate"):
+ self.slapd.terminate()
+ else:
+ # Older python versions don't have .terminate()
+ import signal
+ os.kill(self.slapd.pid, signal.SIGTERM)
+
+ #and now wait for it to die
+ self.slapd.communicate()
+
self.shutdown = ldap_backend_shutdown
if self.type == "fedora-ds":