Merge "Use a template to generate the 'whereto' testing data"

This commit is contained in:
Zuul 2019-03-04 14:11:59 +00:00 committed by Gerrit Code Review
commit 6c31dd3b63
4 changed files with 18 additions and 17 deletions

View File

@ -472,17 +472,25 @@ def build_finished(app, exception):
if exception is not None:
return
redirections = generate_constraints_redirections(_deliverables)
rendered_output = app.builder.templates.render(
'htaccess',
dict(redirections=generate_constraints_redirections(_deliverables))
dict(redirections=redirections)
)
output_full_name = os.path.join(app.builder.outdir, '.htaccess')
with open(output_full_name, "w") as f:
f.write(rendered_output)
LOG.info('Wrote Redirections to %s' % (output_full_name))
# NOTE(tonyb): We want to output this here because we won't be able to
# get to it via http{,s} so this helps debugging.
LOG.debug(rendered_output)
rendered_output = app.builder.templates.render(
'redirect-tests',
dict(redirections=redirections)
)
output_full_name = os.path.join(app.builder.outdir,
'..',
'redirect-tests.txt')
with open(output_full_name, "w") as f:
f.write(rendered_output)
def setup(app):

View File

@ -0,0 +1,5 @@
/teams/shade.html 301 /teams/openstacksdk.html
/constraints/upper/master 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master
{%- for redirection in redirections %}
/constraints/upper/{{ redirection.src }} {{ redirection.code }} http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h={{ redirection.dst }}
{%- endfor %}

View File

@ -1,12 +0,0 @@
/teams/shade.html 301 /teams/openstacksdk.html
/constraints/upper/master 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master
/constraints/upper/stein 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master
/constraints/upper/rocky 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky
/constraints/upper/queens 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens
/constraints/upper/pike 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike
/constraints/upper/ocata 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata
/constraints/upper/newton 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/newton
/constraints/upper/mitaka 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=mitaka-eol
/constraints/upper/liberty 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=liberty-eol
/constraints/upper/kilo 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=kilo-eol
/constraints/upper/juno 301 http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=juno-eol

View File

@ -74,7 +74,7 @@ deps =
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -v -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
whereto {toxinidir}/doc/build/html/.htaccess {toxinidir}/doc/test/redirect-tests.txt
whereto {toxinidir}/doc/build/html/.htaccess {toxinidir}/doc/build/redirect-tests.txt
[flake8]
# E123, E125 skipped as they are invalid PEP-8.