Fail the doc build if we have any warnings.

And fix existing warnings so we won't fail the doc build.

Change-Id: Idec00e3f458b4f87c2e76e4d95971ed52dd6f837
This commit is contained in:
Daniel Watkins 2015-06-12 17:41:27 +01:00
parent d77c927bc2
commit 5fecfffc76
2 changed files with 28 additions and 21 deletions

View File

@ -77,7 +77,7 @@ class RequestsResponse(object):
"""A wrapper for requests responses (that provides common functions). """A wrapper for requests responses (that provides common functions).
This exists so that things like StringResponse or FileResponse can This exists so that things like StringResponse or FileResponse can
also exist, but with different sources of there response (aka not also exist, but with different sources of their response (aka not
just from the requests library). just from the requests library).
""" """
@ -143,19 +143,23 @@ def read_url(url, data=None, timeout=None, retries=0,
check_status=True, allow_redirects=True): check_status=True, allow_redirects=True):
"""Fetch a url (or post to one) with the given options. """Fetch a url (or post to one) with the given options.
url: url to fetch :param url: url to fetch
data: any data to POST (this switches the request method to POST :param data:
instead of GET) any data to POST (this switches the request method to POST
timeout: the timeout (in seconds) to wait for a response instead of GET)
headers: any headers to provide (and send along) in the request :param timeout: the timeout (in seconds) to wait for a response
ssl_details: a dictionary containing any ssl settings, cert_file, :param headers: any headers to provide (and send along) in the request
ca_certs and verify are valid entries (and they are only :param ssl_details:
used when the url provided is https) a dictionary containing any ssl settings, cert_file, ca_certs
check_status: checks that the response status is OK after fetching (this and verify are valid entries (and they are only used when the
ensures a exception is raised on non-OK status codes) url provided is https)
allow_redirects: enables redirects (or disables them) :param check_status:
retries: maximum number of retries to attempt when fetching the url and checks that the response status is OK after fetching (this
the fetch fails ensures a exception is raised on non-OK status codes)
:param allow_redirects: enables redirects (or disables them)
:param retries:
maximum number of retries to attempt when fetching the url and
the fetch fails
""" """
url = _clean_url(url) url = _clean_url(url)
request_args = { request_args = {
@ -204,13 +208,15 @@ def wait_any_url(urls, max_wait=None, timeout=None,
exception_cb=None): exception_cb=None):
"""Wait for one of many urls to respond correctly. """Wait for one of many urls to respond correctly.
urls: a list of urls to try :param urls: a list of urls to try
max_wait: roughly the maximum time to wait before giving up :param max_wait: roughly the maximum time to wait before giving up
timeout: the timeout provided to ``read_url`` :param timeout: the timeout provided to ``read_url``
status_cb: call method with string message when a url is not available :param status_cb:
exception_cb: call method with 2 arguments 'msg' (per status_cb) and call method with string message when a url is not available
'exception', the exception that occurred. :param exception_cb:
sleep_time: how long to sleep before trying each url again call method with 2 arguments 'msg' (per status_cb) and
'exception', the exception that occurred.
:param sleep_time: how long to sleep before trying each url again
The idea of this routine is to wait for the EC2 metdata service to The idea of this routine is to wait for the EC2 metdata service to
come up. On both Eucalyptus and EC2 we have seen the case where come up. On both Eucalyptus and EC2 we have seen the case where

View File

@ -39,3 +39,4 @@ build-dir = doc/build
autodoc_index_modules = 1 autodoc_index_modules = 1
autodoc_exclude_modules = autodoc_exclude_modules =
cloudinit.osys.windows.* cloudinit.osys.windows.*
warnerrors = 1