diff options
| author | Stanislav Laznicka <slaznick@redhat.com> | 2016-08-12 11:59:41 +0200 |
|---|---|---|
| committer | Martin Babinsky <mbabinsk@redhat.com> | 2016-08-17 14:58:11 +0200 |
| commit | fea56fefff48b0d8eb147c2c2c511c869a1eadf0 (patch) | |
| tree | 10865b09c2f0769de564455ed096917e52db9182 | |
| parent | 6e6cbda036559e741ead0ab5ba18b0be0b41621e (diff) | |
| download | freeipa-fea56fefff48b0d8eb147c2c2c511c869a1eadf0.tar.gz freeipa-fea56fefff48b0d8eb147c2c2c511c869a1eadf0.tar.xz freeipa-fea56fefff48b0d8eb147c2c2c511c869a1eadf0.zip | |
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
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
| -rw-r--r-- | ipaserver/install/server/install.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 8dc7a6820..48e0b9b7d 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 as e: + raise ScriptError(str(e)) 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)) |
