Insure the admin_conn is disconnected on stop

If we stop or restart the server insure admin_conn gets reset or other
parts may fail to properly connect/authenticate

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Simo Sorce
2015-08-04 10:15:36 -04:00
committed by Jan Cholasta
parent da468ce16b
commit f57b687241

View File

@@ -530,7 +530,14 @@ class DsInstance(service.Service):
# Does not apply with newer DS releases
pass
def stop(self, *args, **kwargs):
if self.admin_conn:
self.ldap_disconnect()
super(DsInstance, self).stop(*args, **kwargs)
def restart(self, instance=''):
if self.admin_conn:
self.ldap_disconnect()
try:
super(DsInstance, self).restart(instance)
if not is_ds_running(instance):