[Freeipa-devel] [PATCH 0063] Raise error on topology disconnect/last-role-host removal during server uninstall

Stanislav Laznicka slaznick at redhat.com
Tue Aug 16 13:47:56 UTC 2016


On 08/15/2016 02:20 PM, Martin Babinsky wrote:
> On 08/15/2016 02:13 PM, Martin Babinsky wrote:
>> On 08/12/2016 12:08 PM, Stanislav Laznicka wrote:
>>> 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
>>>
>>>
>>>
>>
>> The patch seems to be ok, however shouldn't we use sys.exit() when
>> handling ServerRemovalError? Yes raising SystemExit from within a
>> function is a horrible practice, but it is already done on several other
>> places instead of letting the exception bubble up to the main handler.
>>
>> CC'ing Jan for his thoughts on this since I may be wrong.
>>
> Hmm, you will definitely need sys.exit() here since otherwise 
> ipa-server-install reports 0 exit code even if there was an exception 
> thrown:
>
> """
> [root at master1 ~]# ipa-server-install --uninstall -U
> ipa         : ERROR    Server removal aborted: Deleting this server 
> will leave your installation without a DNS..
> [root at master1 ~]# echo $?
> 0
> """
>
Because of #5750 (remove sys.exit() calls from installer modules) I 
rather raise ScriptError in this case. See the modified patch. It 
depends on either of my 48-4 or 48-5 patches (pick one).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-slaznick-0063-2-Fail-on-topology-disconnect-last-role-removal.patch
Type: text/x-patch
Size: 1641 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160816/3e489724/attachment.bin>


More information about the Freeipa-devel mailing list