From 431f42703acfb2f22c034a336277dcb2c320928a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 4 Aug 2015 10:15:36 -0400 Subject: [PATCH] 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 Reviewed-By: Jan Cholasta --- ipaserver/install/dsinstance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py index 7044782bac8068f7470b62bd7489b5319269b119..cadf9ccbe8ed0a20813af3fd671b18942a918b0b 100644 --- a/ipaserver/install/dsinstance.py +++ b/ipaserver/install/dsinstance.py @@ -478,7 +478,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): -- 2.5.0