Without this patch, upgrade may failed when api.Backend.ldap2 was connected before DS restart.

Patch attached.

--
Martin Basti

From cae5117b505f24fc176196fc953170e3bad0507b Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Wed, 10 Jun 2015 13:24:48 +0200
Subject: [PATCH] Server Upgrade: disconnect ldap2 connection before DS restart

Without this patch, the invalid api.Backend.ldap2 connection
was used to communicate with DS and it raises network error
after DS restart.
---
 ipaserver/install/server/upgrade.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
index 306d1d27cda7a517117110ad3e6a760108f0fe19..a9dac59e009f5646630b7a8dd0e92f39b5a44a86 100644
--- a/ipaserver/install/server/upgrade.py
+++ b/ipaserver/install/server/upgrade.py
@@ -1369,6 +1369,11 @@ def upgrade_configuration():
     ds = dsinstance.DsInstance()
     ds.configure_dirsrv_ccache()
 
+    # ldap2 connection is not valid after DS restart, close connection otherwise
+    # it will cause network errors
+    if api.Backend.ldap2.isconnected():
+        api.Backend.ldap2.disconnect()
+
     ds.stop(ds_serverid)
     fix_schema_file_syntax()
     remove_ds_ra_cert(subject_base)
-- 
2.1.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to