From 87ca0d72fa7de93089f77974f26e497533a46be5 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 16 Oct 2018 14:21:33 -0500 Subject: [PATCH] Update sphinx extension logging Sphinx 1.6 deprecated using the application object to perform logging and it will be removed in the upcoming 2.0 release. This updates our extensions to use the recommended sphinx.util.logging instead. Change-Id: I3abce4e3c147befd0235820cb8850fe18f6dee42 Signed-off-by: Sean McGinnis --- doc/ext/list_plugins.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/ext/list_plugins.py b/doc/ext/list_plugins.py index 96268804..8d4dcd03 100644 --- a/doc/ext/list_plugins.py +++ b/doc/ext/list_plugins.py @@ -16,10 +16,12 @@ from docutils import nodes from docutils.parsers import rst from docutils.parsers.rst import directives from docutils.statemachine import ViewList +from sphinx.util import logging from sphinx.util.nodes import nested_parse_with_titles - from stevedore import extension +LOG = logging.getLogger(__name__) + class ListAuthPluginsDirective(rst.Directive): """Present a simple list of the plugins in a namespace.""" @@ -32,12 +34,8 @@ class ListAuthPluginsDirective(rst.Directive): has_content = True - @property - def app(self): - return self.state.document.settings.env.app - def report_load_failure(mgr, ep, err): - self.app.warn(u'Failed to load %s: %s' % (ep.module_name, err)) + LOG.warning(u'Failed to load %s: %s' % (ep.module_name, err)) def display_plugin(self, ext): overline_style = self.options.get('overline-style', '') @@ -89,5 +87,5 @@ class ListAuthPluginsDirective(rst.Directive): def setup(app): - app.info('loading keystoneauth1 plugins') + LOG.info('loading keystoneauth1 plugins') app.add_directive('list-auth-plugins', ListAuthPluginsDirective)