Martin Kosek wrote:
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
I modified your patch very slightly to add a period to the end of
"Please fix your /etc/hosts file" as requested in the ticket.
Ack, pushed to master
rob
_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel