From aa37db5a12fcd8f9d9cba56378953f1c16de6d46 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Oct 2009 14:54:21 +1100 Subject: s4:provision Inline 'ldap_backend_shutdown' for clarity --- source4/scripting/python/samba/provision.py | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index f570599e627..72366677558 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": -- cgit