From 0bd7e90d32f5300ff0501c502b35f94419f4b92f Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 16 Oct 2018 14:35:47 -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: Ia9edbfd551d260b798818940e4d156957f382324 Signed-off-by: Sean McGinnis --- oslo_policy/sphinxpolicygen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/oslo_policy/sphinxpolicygen.py b/oslo_policy/sphinxpolicygen.py index 427559f8..c6158c6b 100644 --- a/oslo_policy/sphinxpolicygen.py +++ b/oslo_policy/sphinxpolicygen.py @@ -17,15 +17,19 @@ import os +from sphinx.util import logging + from oslo_policy import generator +LOG = logging.getLogger(__name__) + def generate_sample(app): """Generate a sample policy file.""" if not app.config.policy_generator_config_file: - app.warn("No policy_generator_config_file is specified, " - "skipping sample policy generation") + LOG.warning("No policy_generator_config_file is specified, " + "skipping sample policy generation") return if isinstance(app.config.policy_generator_config_file, list): @@ -46,7 +50,7 @@ def _get_default_basename(config_file): def _generate_sample(app, policy_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.