From 8f36a5bd68140fdd338d9c738977a6c67fdfdf08 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 9 Dec 2015 15:56:24 +0100 Subject: [PATCH] replica install: add ipaservers if it does not exist This prevents crash when adding the host entry to ipaservers when installing replica of a 4.2 or older server. https://fedorahosted.org/freeipa/ticket/3416 Reviewed-By: Martin Babinsky --- ipaserver/install/krbinstance.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py index f928e501f..cd803b017 100644 --- a/ipaserver/install/krbinstance.py +++ b/ipaserver/install/krbinstance.py @@ -41,6 +41,7 @@ from ipapython.dn import DN from ipaserver.install import replication from ipaserver.install import dsinstance +from ipaserver.install import ldapupdate import pyasn1.codec.ber.decoder import struct @@ -118,11 +119,9 @@ class KrbInstance(service.Service): self.admin_conn.add_entry(host_entry) # Add the host to the ipaserver host group - hostgroup_dn = DN(('cn', 'ipaservers'), ('cn', 'hostgroups'), - ('cn', 'accounts'), self.suffix) - hostgroup_entry = self.admin_conn.get_entry(hostgroup_dn, ['member']) - hostgroup_entry.setdefault('member', []).append(host_dn) - self.admin_conn.update_entry(hostgroup_entry) + ld = ldapupdate.LDAPUpdate(ldapi=True) + ld.update([os.path.join(paths.UPDATES_DIR, + '20-ipaservers_hostgroup.update')]) def __common_setup(self, realm_name, host_name, domain_name, admin_password): self.fqdn = host_name