Hello,

topology disconnect/last-role-host removal errors would just be logged during server uninstall even if ignore options are not present. The host would still appear in the topology even after "successful" uninstall.


https://fedorahosted.org/freeipa/ticket/6168

From b8099217336af8ed191bed67303d1e52505c2a86 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 12 Aug 2016 11:59:41 +0200
Subject: [PATCH] Fail on topology disconnect/last role removal

Disconnecting topology/removing last-role-host during server
uninstallation should raise error rather than just being logged
if the appropriate ignore settings are not present.

https://fedorahosted.org/freeipa/ticket/6168
---
 ipaserver/install/server/install.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 94698898934844350488d5fc52d6e1e567624502..7aa2590f65fd0dda7f8faf4056bf7cce7032e1b4 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -294,7 +294,6 @@ def common_cleanup(func):
 def remove_master_from_managed_topology(api_instance, options):
     try:
         # we may force the removal
-        # if the master was already deleted we will just get a warning
         server_del_options = dict(
             force=True,
             ignore_topology_disconnect=options.ignore_topology_disconnect,
@@ -303,8 +302,10 @@ def remove_master_from_managed_topology(api_instance, options):
 
         replication.run_server_del_as_cli(
             api_instance, api_instance.env.host, **server_del_options)
-
+    except errors.ServerRemovalError:
+        raise
     except Exception as e:
+        # if the master was already deleted we will just get a warning
         root_logger.warning("Failed to delete master: {}".format(e))
 
 
-- 
2.7.4

-- 
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

Reply via email to