Fix safety checks to prevent orphaning replicas

This is just a typo, we were checking one side twice and never the other
side. So depending on which side you run the command you'd be able or not
to remove the replication agreement even if it was the last one.

First part of ticket: https://fedorahosted.org/freeipa/ticket/2925
This commit is contained in:
Simo Sorce 2012-07-12 14:27:55 -04:00 committed by Rob Crittenden
parent 67dbde0156
commit 87040c0af1

View File

@ -211,7 +211,7 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
try:
repl2 = replication.ReplicationManager(realm, replica2, dirman_passwd)
repl_list = repl1.find_ipa_replication_agreements()
repl_list = repl2.find_ipa_replication_agreements()
if not force and len(repl_list) <= 1:
print "Cannot remove the last replication link of '%s'" % replica2
print "Please use the 'del' command to remove it from the domain"