-
Committer:
Soren Hansen
-
Date:
2009-09-08 09:00:48 UTC
-
Revision ID:
soren@canonical.com-20090908090048-rlbbhf6h4okus7aw
Attempting to fetch userdata will hang for a very long time if the user has not
provided any userdata.
This is because retry_url treats a 404 (which is a valid response meaning that
the user did not provide any userdata) like a network error (which usually
means that the network has not come up yet, or that that user- and meta-data
service is not available yet.
This patch adds a retry_on_404 kwarg to retry_url. If True (which is the
default) retry_url will do what it used to do. If False, it will treat 404 as a
valid response and return ''. Defaulting to True is rather conservative as I
suspect that this new behaviour is desired in most cases, but I'll leave that
decision to you.
Bug first reported as:
https://bugs.launchpad.net/ubuntu/+source/python-boto/+bug/419306