Fixup intersphinx docs

Setup intersphinx in doc building and correct doc links to oslo.config
and dogpile.cache.

Change-Id: I2f6daded5ee8ddafce03b5165d386b1349dc107e
This commit is contained in:
Jamie Lennox 2016-06-09 17:40:33 +10:00
parent 43f4c9781f
commit a7709f65c1
2 changed files with 11 additions and 6 deletions

View File

@ -22,6 +22,7 @@ sys.path.insert(0, os.path.abspath('../..'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'oslosphinx', 'oslosphinx',
'oslo_config.sphinxext', 'oslo_config.sphinxext',
] ]
@ -74,5 +75,8 @@ latex_documents = [
u'OpenStack Foundation', 'manual'), u'OpenStack Foundation', 'manual'),
] ]
# Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {
# intersphinx_mapping = {'http://docs.python.org/': None} 'python': ('https://docs.python.org/', None),
'osloconfig': ('http://docs.openstack.org/developer/oslo.config/', None),
'dogpilecache': ('https://dogpilecache.readthedocs.io/en/latest/', None),
}

View File

@ -164,7 +164,7 @@ def create_region():
a memoized method is called. a memoized method is called.
:returns: The new region. :returns: The new region.
:rtype: :class:`dogpile.cache.CacheRegion` :rtype: :class:`dogpile.cache.region.CacheRegion`
""" """
@ -181,10 +181,11 @@ def configure_cache_region(conf, region):
:param conf: config object, must have had :func:`configure` called on it. :param conf: config object, must have had :func:`configure` called on it.
:type conf: oslo_config.cfg.ConfigOpts :type conf: oslo_config.cfg.ConfigOpts
:param region: Cache region to configure (see :func:`create_region`). :param region: Cache region to configure (see :func:`create_region`).
:type region: dogpile.cache.CacheRegion :type region: dogpile.cache.region.CacheRegion
:raises oslo_cache.exception.ConfigurationError: If the region parameter is :raises oslo_cache.exception.ConfigurationError: If the region parameter is
not a dogpile.cache.CacheRegion. not a dogpile.cache.CacheRegion.
:returns: The region. :returns: The region.
:rtype: :class:`dogpile.cache.region.CacheRegion`
""" """
if not isinstance(region, dogpile.cache.CacheRegion): if not isinstance(region, dogpile.cache.CacheRegion):
raise exception.ConfigurationError( raise exception.ConfigurationError(
@ -330,6 +331,7 @@ def get_memoization_decorator(conf, region, group, expiration_group=None):
:param conf: config object, must have had :func:`configure` called on it. :param conf: config object, must have had :func:`configure` called on it.
:type conf: oslo_config.cfg.ConfigOpts :type conf: oslo_config.cfg.ConfigOpts
:param region: region as created by :func:`create_region`. :param region: region as created by :func:`create_region`.
:type region: dogpile.cache.region.CacheRegion
:param group: name of the configuration group to examine :param group: name of the configuration group to examine
:type group: string :type group: string
:param expiration_group: name of the configuration group to examine :param expiration_group: name of the configuration group to examine
@ -362,10 +364,9 @@ def configure(conf):
Register the required oslo.cache config options into an oslo.config CONF Register the required oslo.cache config options into an oslo.config CONF
object. object.
This must be called before conf(). This must be called before :py:func:`configure_cache_region`.
:param conf: The configuration object. :param conf: The configuration object.
:type conf: oslo_config.cfg.ConfigOpts :type conf: oslo_config.cfg.ConfigOpts
""" """
_opts.configure(conf) _opts.configure(conf)