Comment 8 for bug 945505

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Perhaps we can make the code pragmatic and work around the issue when it is obvious that we have run into it:

# In pseudo-python
try:
    address = gethostbyname(api_response['publicHostname'])
except DnsError:
    address = api_response['publicIpAddress']

This works in all cases, as it takes advantage of Amazon's split DNS views for optimal addresses, and when the hostname is not resolvable, falls back to whatever the API told us the "most accessible" address was.

Is there any reason not to be more robust like this?