Merge "Update sphinx extension logging"
This commit is contained in:
commit
fe898122c8
@ -17,15 +17,19 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from sphinx.util import logging
|
||||||
|
|
||||||
from oslo_policy import generator
|
from oslo_policy import generator
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def generate_sample(app):
|
def generate_sample(app):
|
||||||
"""Generate a sample policy file."""
|
"""Generate a sample policy file."""
|
||||||
|
|
||||||
if not app.config.policy_generator_config_file:
|
if not app.config.policy_generator_config_file:
|
||||||
app.warn("No policy_generator_config_file is specified, "
|
LOG.warning("No policy_generator_config_file is specified, "
|
||||||
"skipping sample policy generation")
|
"skipping sample policy generation")
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(app.config.policy_generator_config_file, list):
|
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 _generate_sample(app, policy_file, base_name):
|
||||||
|
|
||||||
def info(msg):
|
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
|
# If we are given a file that isn't an absolute path, look for it
|
||||||
# in the source directory if it doesn't exist.
|
# in the source directory if it doesn't exist.
|
||||||
|
Loading…
Reference in New Issue
Block a user