summaryrefslogtreecommitdiffstats
path: root/install/tools
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-05-13 15:13:21 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-03 14:48:19 +0200
commit72f5c52d8cca32d8de5e8e0228d8ad3246efda48 (patch)
tree61af3732c4069d8036671aa16f2a4c7e816c7560 /install/tools
parent8b7f2500ba16029faf02ae9318c0e1c51f60ffac (diff)
downloadfreeipa-72f5c52d8cca32d8de5e8e0228d8ad3246efda48.tar.gz
freeipa-72f5c52d8cca32d8de5e8e0228d8ad3246efda48.tar.xz
freeipa-72f5c52d8cca32d8de5e8e0228d8ad3246efda48.zip
fixes premature sys.exit in ipa-replica-manage del
Deletion of a replica would fail should there be no RUVs on the server. Also removed some dead code in del_master_managed which might cause premature exit if RuntimeError occurs. https://fedorahosted.org/freeipa/ticket/5307 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'install/tools')
-rwxr-xr-xinstall/tools/ipa-replica-manage11
1 files changed, 5 insertions, 6 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 9f6cfa6ca..df0edb3b2 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -465,9 +465,12 @@ def get_rid_by_host(realm, sourcehost, host, dirman_passwd, nolookup=False):
"""
try:
servers = get_ruv(realm, sourcehost, dirman_passwd, nolookup)
- except (NoRUVsFound, RuntimeError) as e:
+ except RuntimeError as e:
print(e)
- sys.exit(0 if isinstance(e, NoRUVsFound) else 1)
+ sys.exit(1)
+ except NoRUVsFound as e:
+ print(e)
+ servers = []
for (netloc, rid) in servers:
if '%s:389' % host == netloc:
return int(rid)
@@ -963,10 +966,6 @@ def del_master_managed(realm, hostname, options):
# And pick new CA master.
ensure_last_services(api.Backend.ldap2, hostname, masters, options)
- # Save the RID value before we start deleting
- rid = get_rid_by_host(realm, options.host, hostname,
- options.dirman_passwd, options.nolookup)
-
# 5. Remove master entry. Topology plugin will remove replication agreements.
try:
api.Command.server_del(hostname_u)