summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-12-14 10:51:19 -0500
committerSimo Sorce <ssorce@redhat.com>2010-12-21 17:28:13 -0500
commita21d91c0035b68bb5df864240cd2a2c8d0ecdf55 (patch)
tree12779e6d45183ee3e2adff5f0d1106bd3f6b4704 /ipaserver/install
parent1cf67fe8503981b8aca985043bc5a8cd2799a365 (diff)
downloadfreeipa-a21d91c0035b68bb5df864240cd2a2c8d0ecdf55.tar.gz
freeipa-a21d91c0035b68bb5df864240cd2a2c8d0ecdf55.tar.xz
freeipa-a21d91c0035b68bb5df864240cd2a2c8d0ecdf55.zip
Add disconnect command to ipa-replica-manage
Can remove replication agreements between 2 replicas as long as it is not the last agreement (except for Ad replication agreements, which can always be removed). Fixes: https://fedorahosted.org/freeipa/ticket/551
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/replication.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index fbe4d2f76..000529f47 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -135,6 +135,28 @@ class ReplicationManager:
return []
return [ent.dn for ent in ents]
+ def find_ipa_replication_agreements(self):
+ """
+ The replication agreements are stored in
+ cn="$SUFFIX",cn=mapping tree,cn=config
+
+ Return the list of hosts we have replication agreements.
+ """
+
+ res = []
+
+ filt = "(objectclass=nsds5ReplicationAgreement)"
+ try:
+ ents = self.conn.search_s("cn=mapping tree,cn=config",
+ ldap.SCOPE_SUBTREE, filt)
+ except ldap.NO_SUCH_OBJECT:
+ return res
+
+ for ent in ents:
+ res.append(ent.nsds5replicahost)
+
+ return res
+
def add_replication_manager(self, conn, passwd=None):
"""
Create a pseudo user to use for replication. If no password