summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-11-07 17:21:08 +0100
committerJan Cholasta <jcholast@redhat.com>2016-11-11 12:17:25 +0100
commit37578cfc2bbec99d75b19c94c337c406bf6a6ef7 (patch)
tree5fbed4a33e47307561979fdbeb6d75c8efb28c61
parentbc2e3386e7fa30211a46c0c2284d901cc2509147 (diff)
Use same means of checking replication agreements on both DLs
https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rw-r--r--ipaserver/install/server/replicainstall.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 72309ffd9..5892c1c32 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -1128,20 +1128,13 @@ def promote_check(installer):
promotion_check_ipa_domain(conn, remote_api.env.basedn)
# Check that we don't already have a replication agreement
- try:
- _acn, adn = replman.agreement_dn(config.host_name)
- conn.get_entry(adn, ['*'])
- except errors.NotFound:
- pass
- else:
- root_logger.info('Error: A replication agreement for this '
- 'host already exists.')
- print('A replication agreement for this host already exists. '
- 'It needs to be removed.')
- print("Run this command:")
- print(" %% ipa-replica-manage del %s --force" %
- config.host_name)
- raise ScriptError(rval=3)
+ if replman.get_replication_agreement(config.host_name):
+ msg = ("A replication agreement for this host already exists. "
+ "It needs to be removed.\n"
+ "Run this command:\n"
+ " %% ipa-replica-manage del {host} --force"
+ .format(host=config.host_name))
+ raise ScriptError(msg, rval=3)
# Detect if current level is out of supported range
# for this IPA version