From c09b80440a5b8055a67c36706e20ddd80110b4bf Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 16 Oct 2018 14:31:51 -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: Id7da5a90b804420ece0699e4986b382e6d8bc8f2 Signed-off-by: Sean McGinnis --- oslo_config/sphinxconfiggen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/oslo_config/sphinxconfiggen.py b/oslo_config/sphinxconfiggen.py index 9c3cdbf5..ff7172cb 100644 --- a/oslo_config/sphinxconfiggen.py +++ b/oslo_config/sphinxconfiggen.py @@ -14,14 +14,18 @@ import os +from sphinx.util import logging + from oslo_config import generator +LOG = logging.getLogger(__name__) + def generate_sample(app): if not app.config.config_generator_config_file: - app.warn("No config_generator_config_file is specified, " - "skipping sample config generation") + LOG.warning("No config_generator_config_file is specified, " + "skipping sample config generation") return # Decided to update the existing config option @@ -52,7 +56,7 @@ def _get_default_basename(config_file): def _generate_sample(app, config_file, base_name): def info(msg): - app.info('[%s] %s' % (__name__, msg)) + LOG.info('[%s] %s' % (__name__, msg)) # If we are given a file that isn't an absolute path, look for it # in the source directory if it doesn't exist.