[Freeipa-devel] [PATCH] 029 ipa-dns-install does not exit on error

Martin Kosek mkosek at redhat.com
Fri Feb 11 07:45:23 UTC 2011


On Thu, 2011-02-10 at 13:58 -0500, Rob Crittenden wrote:
> Martin Kosek wrote:
> > This patch fixes behavior of ipa-dns-install, which does not
> > exit when an invalid configuration of /etc/hosts is detected.
> >
> > https://fedorahosted.org/freeipa/ticket/736
> 
> I'm not positive but was the address info checking done within the try 
> to catch any possible exception?
> 
> This code dates back to very early IPA code (say 4 years old or so) when 
> we were pretty new to python and somethings catching things in a very 
> broad way.
> 
> Is it possible that running through the addresses could raise an 
> unhandled exception?
> 
> rob

Rob, thanks for the review. Well, I think the unhandled code should not
raise any exception - we are not calling any external function, just
going through an array. But to bulletproof it, I have added a check just
to be sure that we do it right even when socket.getaddrinfo would return
empty result and did not raise an exception. Patch is attached.

I moved the exception handling closer to the socket.getaddrinfo to
actually be able to easily call sys.exit().

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkosek-freeipa-029-02-ipa-dns-install-does-not-exit-on-error.patch
Type: text/x-patch
Size: 2452 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110211/7bfd2295/attachment.bin>


More information about the Freeipa-devel mailing list