pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0198-Fix-connections-to-DS-during-installation.patch

aa60fb
From 520e2ed9c5b2cfe3e3231bd616639bddb16d6995 Mon Sep 17 00:00:00 2001
aa60fb
From: Martin Basti <mbasti@redhat.com>
aa60fb
Date: Tue, 1 Mar 2016 17:36:55 +0100
aa60fb
Subject: [PATCH] Fix connections to DS during installation
aa60fb
aa60fb
Regression caused by commit 9818e463f5d0a91b300801ee7c8f31f25de402b2,
aa60fb
admin_conn should be connected in method if there is no connection.
aa60fb
aa60fb
https://fedorahosted.org/freeipa/ticket/5665
aa60fb
aa60fb
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
aa60fb
---
aa60fb
 ipaserver/install/dsinstance.py | 6 ++++++
aa60fb
 1 file changed, 6 insertions(+)
aa60fb
aa60fb
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
aa60fb
index cadf9ccbe8ed0a20813af3fd671b18942a918b0b..4ad0f9e7def8a10b1eaffce1b3d9cadd9cdcc689 100644
aa60fb
--- a/ipaserver/install/dsinstance.py
aa60fb
+++ b/ipaserver/install/dsinstance.py
aa60fb
@@ -938,6 +938,9 @@ class DsInstance(service.Service):
aa60fb
         """
aa60fb
         Add sidgen plugin configuration only if it does not already exist.
aa60fb
         """
aa60fb
+        if not self.admin_conn:
aa60fb
+            self.ldap_connect()
aa60fb
+
aa60fb
         dn = DN('cn=IPA SIDGEN,cn=plugins,cn=config')
aa60fb
         try:
aa60fb
             self.admin_conn.get_entry(dn)
aa60fb
@@ -956,6 +959,9 @@ class DsInstance(service.Service):
aa60fb
         """
aa60fb
         Add extdom configuration if it does not already exist.
aa60fb
         """
aa60fb
+        if not self.admin_conn:
aa60fb
+            self.ldap_connect()
aa60fb
+
aa60fb
         dn = DN('cn=ipa_extdom_extop,cn=plugins,cn=config')
aa60fb
         try:
aa60fb
             self.admin_conn.get_entry(dn)
aa60fb
-- 
aa60fb
2.5.0
aa60fb