--- oslosphinx-4.18.0/oslosphinx/__init__.py~ 2018-01-08 15:12:16.000000000 +0100
+++ oslosphinx-4.18.0/oslosphinx/__init__.py 2019-08-04 12:04:46.928166116 +0200
@@ -18,7 +18,8 @@
from six.moves.urllib import parse
import string
import subprocess
-
+from sphinx.util import logging
+LOG = logging.getLogger(__name__)
CGIT_BASE = 'http://git.openstack.org/cgit/'
@@ -57,7 +58,7 @@
git_cmd, stdout=subprocess.PIPE).communicate()[0]
raw_version_list = raw_version_list.decode("utf8")
except OSError:
- app.warn('Cannot get tags from git repository. '
+ LOG.warn('Cannot get tags from git repository. '
'Not setting "other_versions".')
raw_version_list = u''
@@ -73,7 +74,7 @@
def builder_inited(app):
theme_dir = os.path.join(os.path.dirname(__file__), 'theme')
- app.info('Using openstack theme from %s' % theme_dir)
+ LOG.info('Using openstack theme from %s' % theme_dir)
# Insert our theme directory at the front of the search path and
# force the theme setting to use the one in the package unless
# another openstack theme is already selected. This is done here,
--- oslosphinx-4.18.0/oslosphinx/check_blueprints.py~ 2018-01-08 15:12:16.000000000 +0100
+++ oslosphinx-4.18.0/oslosphinx/check_blueprints.py 2019-08-04 12:04:23.136895987 +0200
@@ -15,7 +15,8 @@
"""
import requests
-
+from sphinx.util import logging
+LOG = logging.getLogger(__name__)
class BlueprintChecker(object):
@@ -74,11 +75,11 @@
def blueprint_exists(self, project_name, bp_name):
"""Return boolean indicating whether the blueprint exists."""
- self.app.info('Checking for %s in %s' % (bp_name, project_name))
+ LOG.info('Checking for %s in %s' % (bp_name, project_name))
url = self.BP_URL_TEMPLATE % (project_name, bp_name)
response = requests.get(url)
if response.status_code == 200:
- self.app.info('Found %s in %s' % (bp_name, project_name))
+ LOG.info('Found %s in %s' % (bp_name, project_name))
return True
return False
@@ -87,7 +88,7 @@
if bp_name in self._good_bps:
return True
self._load_project_settings()
- self.app.info('') # emit newline
+ LOG.info('') # emit newline
candidate_project, dash, bp_name_to_find = bp_name.partition('-')
if candidate_project in self.project_names:
# First check the shortened name of the blueprint in the project.
@@ -96,13 +97,13 @@
# Then check the full name of the blueprint in the project.
if self.blueprint_exists(candidate_project, bp_name):
return
- self.app.info(
+ LOG.info(
('Blueprint name %r looks like it starts with a project '
'name, but %r was not found in project %r') %
(bp_name, bp_name_to_find, candidate_project)
)
else:
- self.app.info(
+ LOG.info(
'Blueprint checking is faster if the file names '
'start with the launchpad project name.'
)
@@ -111,7 +112,7 @@
self._good_bps.add(bp_name)
break
else:
- self.app.warn(
+ LOG.warn(
'Could not find a blueprint called %r in %s'
% (bp_name, self._warn_search),
location=(bp_name, 0),
@@ -122,7 +123,7 @@
def setup(app):
- app.info('Initializing %s' % __name__)
+ LOG.info('Initializing %s' % __name__)
checker = BlueprintChecker(app)
app.connect('doctree-resolved', checker.doctree_resolved)
app.add_config_value('check_blueprints_project_group', 'openstack', 'env')