summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-12-07 14:00:09 +0100
committerMartin Babinsky <mbabinsk@redhat.com>2016-12-09 15:47:13 +0100
commit6d0e450c8226a8e23d88cf21487a77db66a2968b (patch)
tree1b9c2f6ac3409d84934d57cb425a6b97f078e0a2
parent6086a6dbad21d93ed584d508f9844d73f64a4542 (diff)
downloadfreeipa-6d0e450c8226a8e23d88cf21487a77db66a2968b.tar.gz
freeipa-6d0e450c8226a8e23d88cf21487a77db66a2968b.tar.xz
freeipa-6d0e450c8226a8e23d88cf21487a77db66a2968b.zip
add missing attribute to ipaca replica during CA topology update
'nsds5replicabinddngroupcheckinterval' attribute was not properly added to 'o=ipaca' replica attribute during upgrade. The CA topology update plugin should now add it to the entry if it exists. https://fedorahosted.org/freeipa/ticket/6508 Reviewed-By: Martin Basti <mbasti@redhat.com>
-rw-r--r--ipaserver/install/plugins/update_ca_topology.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ipaserver/install/plugins/update_ca_topology.py b/ipaserver/install/plugins/update_ca_topology.py
index d76849bf9..f82926b19 100644
--- a/ipaserver/install/plugins/update_ca_topology.py
+++ b/ipaserver/install/plugins/update_ca_topology.py
@@ -2,8 +2,10 @@
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
+from ipalib import errors
from ipalib import Registry
from ipalib import Updater
+from ipapython.dn import DN
from ipaserver.install import certs, cainstance
from ipaserver.install import ldapupdate
from ipaplatform.paths import paths
@@ -31,4 +33,24 @@ class update_ca_topology(Updater):
ld.update([paths.CA_TOPOLOGY_ULDIF])
+ ldap = self.api.Backend.ldap2
+
+ ca_replica_dn = DN(
+ ('cn', 'replica'),
+ ('cn', 'o=ipaca'),
+ ('cn', 'mapping tree'),
+ ('cn', 'config'))
+
+ check_interval_attr = 'nsds5replicabinddngroupcheckinterval'
+ default_check_interval = ['60']
+
+ try:
+ ca_replica_entry = ldap.get_entry(ca_replica_dn)
+ except errors.NotFound:
+ pass
+ else:
+ if check_interval_attr not in ca_replica_entry:
+ ca_replica_entry[check_interval_attr] = default_check_interval
+ ldap.update_entry(ca_replica_entry)
+
return False, []