summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/dsinstance.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-01-21 14:32:55 -0500
committerSimo Sorce <ssorce@redhat.com>2011-01-25 11:10:27 -0500
commit5bc7e5a9c790c80f73b82f8ef175799b3c84eaaa (patch)
treedfed0a5d4e97f3fa07732b19ac7348162add12d3 /ipaserver/install/dsinstance.py
parent82b4d5d6e8fba52c63831c6aec6b08e604082132 (diff)
downloadfreeipa-5bc7e5a9c790c80f73b82f8ef175799b3c84eaaa.zip
freeipa-5bc7e5a9c790c80f73b82f8ef175799b3c84eaaa.tar.gz
freeipa-5bc7e5a9c790c80f73b82f8ef175799b3c84eaaa.tar.xz
Populate shared tree with replica related values
Fixes: https://fedorahosted.org/freeipa/ticket/820
Diffstat (limited to 'ipaserver/install/dsinstance.py')
-rw-r--r--ipaserver/install/dsinstance.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 9a121ea..7bf29ce 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -737,3 +737,25 @@ class DsInstance(service.Service):
def __root_autobind(self):
self._ldap_mod("root-autobind.ldif")
+ def replica_populate(self):
+ self.ldap_connect()
+
+ dn = "cn=default,ou=profile,%s" % self.suffix
+ try:
+ ret = self.admin_conn.search_s(dn, ldap.SCOPE_BASE,
+ '(objectclass=*)')[0]
+ srvlist = ret.data.get('defaultServerList')
+ if len(srvlist) > 0:
+ srvlist = srvlist[0].split()
+ if not self.fqdn in srvlist:
+ srvlist.append(self.fqdn)
+ attr = ' '.join(srvlist)
+ mod = [(ldap.MOD_REPLACE, 'defaultServerList', attr)]
+ self.admin_conn.modify_s(dn, mod)
+ except ldap.NO_SUCH_OBJECT:
+ pass
+ except ldap.TYPE_OR_VALUE_EXISTS:
+ pass
+
+ self.ldap_disconnect()
+