https://fedorahosted.org/freeipa/ticket/5307
Please see the patch attached.
From a8a3d6f6e6b306d84814a0745cb86b973b66d177 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka <[email protected]> Date: Fri, 13 May 2016 15:13:21 +0200 Subject: [PATCH] fixes premature sys.exit in ipa-replica-manage del Deletion of a replica would fail should there be no RUVs on the server https://fedorahosted.org/freeipa/ticket/5307 --- install/tools/ipa-replica-manage | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index 14e768965601cef08f13792bb5cd086534199538..53283f2d172786a68bcfdfaf1f2f419ef05fae42 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -467,7 +467,10 @@ def get_rid_by_host(realm, sourcehost, host, dirman_passwd, nolookup=False): servers = get_ruv(realm, sourcehost, dirman_passwd, nolookup) except (NoRUVsFound, RuntimeError) as e: print(e) - sys.exit(0 if isinstance(e, NoRUVsFound) else 1) + if isinstance(e, RuntimeError): + sys.exit(1) + else: + return None for (netloc, rid) in servers: if '%s:389' % host == netloc: return int(rid) @@ -962,10 +965,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) -- 2.5.5
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code
