Fix connections to DS during installation

Regression caused by commit 9818e463f5,
admin_conn should be connected in method if there is no connection.

https://fedorahosted.org/freeipa/ticket/5665

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Martin Basti 2016-03-01 17:36:55 +01:00 committed by Petr Vobornik
parent e9922c36b1
commit fcc540bbdc

View File

@ -1067,6 +1067,9 @@ class DsInstance(service.Service):
"""
Add sidgen plugin configuration only if it does not already exist.
"""
if not self.admin_conn:
self.ldap_connect()
dn = DN('cn=IPA SIDGEN,cn=plugins,cn=config')
try:
self.admin_conn.get_entry(dn)
@ -1085,6 +1088,9 @@ class DsInstance(service.Service):
"""
Add extdom configuration if it does not already exist.
"""
if not self.admin_conn:
self.ldap_connect()
dn = DN('cn=ipa_extdom_extop,cn=plugins,cn=config')
try:
self.admin_conn.get_entry(dn)