ansible/ansible — pull request #643 by tima (2012-07-20 21:22:00+00:00)
Title: Handles unix platforms that do not support inet_ntop emitting a message that breaks return json data.

I was getting this error on Red Hat 5.6 boxes:

"socket.error: can't use AF_INET6, IPv6 is disabled"

This caused an ugly stackdump to be returned for each node because the JSON that was returned is invalid. The exception at the end of the stackdump is:

ValueError: No closing quotation

This patch handles it by wrapping the call in a try and if it fails it does not append its data to the ansible_facts data structure and simply returns nothing.