[placement] Make placement_api_docs.py failing

If there is no api reference for some placement API method
tox -e placement-api-ref will fail now.

Change-Id: Ifefedcd51f1f8d5e741ef6d02b7a0879a185e05f
This commit is contained in:
Andrey Volkov 2017-07-06 12:09:16 +03:00 committed by Vladyslav Drok
parent d0af9820e1
commit fa5749727f
2 changed files with 4 additions and 5 deletions

View File

@ -18,6 +18,7 @@ from nova.api.openstack.placement import handler
# A humane ordering of HTTP methods for sorted output.
ORDERED_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']
DEPRECATED_METHODS = [('POST', '/resource_providers/{uuid}/inventories')]
def _header_line(map_entry):
@ -41,7 +42,8 @@ def inspect_doc(doc_files):
header_lines = []
for map_entry in routes:
header_lines.append(_header_line(map_entry))
if map_entry not in DEPRECATED_METHODS:
header_lines.append(_header_line(map_entry))
content_lines = []
for doc_file in doc_files:

View File

@ -145,10 +145,7 @@ commands =
# the Placement API Ref to developer.openstack.org.
commands =
# Check that all placement api routes are in the documentation
# TODO(cdent): Get rid of the leading '-' after all the existing
# routes have been documented. It causes the non-zero exit code to
# ignored.
- python tools/placement_api_docs.py placement-api-ref/source/
python tools/placement_api_docs.py placement-api-ref/source/
rm -rf placement-api-ref/build
sphinx-build -W -b html -d placement-api-ref/build/doctrees placement-api-ref/source placement-api-ref/build/html