From a21d91c0035b68bb5df864240cd2a2c8d0ecdf55 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 14 Dec 2010 10:51:19 -0500 Subject: 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 --- ipaserver/install/replication.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ipaserver/install/replication.py') diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index fbe4d2f7..000529f4 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 -- cgit