Skip to content

Commit

Permalink
Pick up version to be included in documentation from right path.
Browse files Browse the repository at this point in the history
Also bundle it so it can be accessed at
<ip>:8082/documentation/_static/contrail_openapi.json

Change-Id: I6cba6b5eeb3337b9a1f0a9040f8fd336512ce4bf
Partial-Bug: 1621664
(cherry picked from commit f4243d2)
  • Loading branch information
Hampapur Ajay committed Nov 10, 2016
1 parent a195316 commit 1da5483
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/config/api-server/doc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ if os.path.exists('/usr/bin/sphinx-apidoc'):
userdoc_rule = env.Install(Dir('.'), Glob('#controller/src/config/api-server/doc/source/*'))
schema_rule = env.Install(Dir('.'), Glob('#controller/src/schema/*.xsd'))
gendoc_rule = env.Install(Dir('.'), env['TOP'] + '/config/api-server/vnc_cfg_api_server/gen/contrail_openapi.rst')
openapi_rule = env.Install(Dir('.'), env['TOP'] + '/config/api-server/vnc_cfg_api_server/gen/contrail_openapi.json')

html_gen_rule = env.Command('contrail-config', ['Makefile', 'conf.py'],
'make -C ' + Dir('.').path + ' html')
env.Depends(html_gen_rule, [apidoc_rule, gendoc_rule, userdoc_rule, schema_rule])
env.Depends(html_gen_rule,
[apidoc_rule, gendoc_rule, userdoc_rule, schema_rule, openapi_rule])


doc_sources_rules.append(env.Install("../vnc_cfg_api_server", Dir('.')))
Expand Down
6 changes: 3 additions & 3 deletions src/config/api-server/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
# The short X.Y version.
data = '0.99'
try:
with open ("../../../../../src/base/version.info", "r") as myfile:
data=myfile.read().replace('\n', '')
with open("../../../../../controller/src/base/version.info", "r") as f:
data=f.read().replace('\n', '')
except:
pass

Expand Down Expand Up @@ -132,7 +132,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['_static', 'contrail_openapi.json']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down

0 comments on commit 1da5483

Please sign in to comment.