Skip to content
Snippets Groups Projects
Commit 84819f67 authored by gord chung's avatar gord chung
Browse files

fix gendoc

gendoc throws: `AttributeError: 'Sphinx' object has no attribute 'info'`

use logging provided by sphinx.util (not sure why it's using sphinx logger
but meh)
parent 17609df4
No related branches found
No related tags found
No related merge requests found
...@@ -24,11 +24,15 @@ import jinja2 ...@@ -24,11 +24,15 @@ import jinja2
from oslo_config import generator from oslo_config import generator
import six import six
import six.moves import six.moves
from sphinx.util import logging
import webob.request import webob.request
import yaml import yaml
from gnocchi.tests import test_rest from gnocchi.tests import test_rest
LOG = logging.getLogger(__name__)
# HACK(jd) Not sure why but Sphinx setup this multiple times, so we just avoid # HACK(jd) Not sure why but Sphinx setup this multiple times, so we just avoid
# doing several times the requests by using this global variable :( # doing several times the requests by using this global variable :(
_RUN = False _RUN = False
...@@ -223,8 +227,8 @@ def setup(app): ...@@ -223,8 +227,8 @@ def setup(app):
else: else:
request.body = fake_file.read(clen) request.body = fake_file.read(clen)
app.info("Doing request %s: %s" % (entry['name'], LOG.info("Doing request %s: %s",
six.text_type(request))) entry['name'], six.text_type(request))
with webapp.use_admin_user(): with webapp.use_admin_user():
response = webapp.request(request) response = webapp.request(request)
entry['response'] = response entry['response'] = response
...@@ -244,7 +248,7 @@ def setup(app): ...@@ -244,7 +248,7 @@ def setup(app):
f.write(content) f.write(content)
config_output_file = 'doc/source/gnocchi.conf.sample' config_output_file = 'doc/source/gnocchi.conf.sample'
app.info("Generating %s" % config_output_file) LOG.info("Generating %s", config_output_file)
generator.main([ generator.main([
'--config-file', '--config-file',
'%s/gnocchi-config-generator.conf' % os.path.dirname(__file__), '%s/gnocchi-config-generator.conf' % os.path.dirname(__file__),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment