Use OpenStack documentation standards / Nova hypervisor-list API
This patch updates documents for aligning with OpenStack documentation standards which include using the openstackdocstheme. This patch also replaces Nova host-list API calls with hypervisor-list API calls because the former was superseded by the latter [1]. These changes are not related but squashed into one patch for passing gate tests. [1] https://docs.openstack.org/releasenotes/python-novaclient/queens.html#id4 Change-Id: I1fe652c17983f2b4505be50d01a26678bf50ef29 Partial-Bug: #1721489
This commit is contained in:
parent
edbd5aad83
commit
0c286007c3
@ -89,37 +89,39 @@ class HostsTests(test.BaseAdminViewTests):
|
|||||||
self.assertRedirectsNoFollow(res, INDEX_URL)
|
self.assertRedirectsNoFollow(res, INDEX_URL)
|
||||||
|
|
||||||
@test.create_stubs({blazar_api.client: ('host_list', 'host_create',),
|
@test.create_stubs({blazar_api.client: ('host_list', 'host_create',),
|
||||||
api.nova: ('host_list',)})
|
api.nova: ('hypervisor_list',)})
|
||||||
def test_create_hosts(self):
|
def test_create_hosts(self):
|
||||||
blazar_api.client.host_list(IsA(http.HttpRequest)
|
blazar_api.client.host_list(IsA(http.HttpRequest)
|
||||||
).AndReturn([])
|
).AndReturn([])
|
||||||
api.nova.host_list(IsA(http.HttpRequest)
|
api.nova.hypervisor_list(IsA(http.HttpRequest)
|
||||||
).AndReturn(self.novahosts.list())
|
).AndReturn(self.hypervisors.list())
|
||||||
host_names = [h.host_name for h in self.novahosts.list()]
|
hv_hostnames = [hv.hypervisor_hostname
|
||||||
for host_name in host_names:
|
for hv in self.hypervisors.list()]
|
||||||
|
for host_name in hv_hostnames:
|
||||||
blazar_api.client.host_create(
|
blazar_api.client.host_create(
|
||||||
IsA(http.HttpRequest),
|
IsA(http.HttpRequest),
|
||||||
name=host_name,
|
name=host_name,
|
||||||
).AndReturn([])
|
).AndReturn([])
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
form_data = {
|
form_data = {
|
||||||
'select_hosts_role_member': host_names
|
'select_hosts_role_member': hv_hostnames
|
||||||
}
|
}
|
||||||
|
|
||||||
res = self.client.post(CREATE_URL, form_data)
|
res = self.client.post(CREATE_URL, form_data)
|
||||||
self.assertNoFormErrors(res)
|
self.assertNoFormErrors(res)
|
||||||
self.assertMessageCount(success=(len(host_names) + 1))
|
self.assertMessageCount(success=(len(hv_hostnames) + 1))
|
||||||
self.assertRedirectsNoFollow(res, INDEX_URL)
|
self.assertRedirectsNoFollow(res, INDEX_URL)
|
||||||
|
|
||||||
@test.create_stubs({blazar_api.client: ('host_list', 'host_create',),
|
@test.create_stubs({blazar_api.client: ('host_list', 'host_create',),
|
||||||
api.nova: ('host_list',)})
|
api.nova: ('hypervisor_list',)})
|
||||||
def test_create_hosts_with_extra_caps(self):
|
def test_create_hosts_with_extra_caps(self):
|
||||||
blazar_api.client.host_list(IsA(http.HttpRequest)
|
blazar_api.client.host_list(IsA(http.HttpRequest)
|
||||||
).AndReturn([])
|
).AndReturn([])
|
||||||
api.nova.host_list(IsA(http.HttpRequest)
|
api.nova.hypervisor_list(IsA(http.HttpRequest)
|
||||||
).AndReturn(self.novahosts.list())
|
).AndReturn(self.hypervisors.list())
|
||||||
host_names = [h.host_name for h in self.novahosts.list()]
|
hv_hostnames = [hv.hypervisor_hostname
|
||||||
for host_name in host_names:
|
for hv in self.hypervisors.list()]
|
||||||
|
for host_name in hv_hostnames:
|
||||||
blazar_api.client.host_create(
|
blazar_api.client.host_create(
|
||||||
IsA(http.HttpRequest),
|
IsA(http.HttpRequest),
|
||||||
name=host_name,
|
name=host_name,
|
||||||
@ -127,13 +129,13 @@ class HostsTests(test.BaseAdminViewTests):
|
|||||||
).AndReturn([])
|
).AndReturn([])
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
form_data = {
|
form_data = {
|
||||||
'select_hosts_role_member': host_names,
|
'select_hosts_role_member': hv_hostnames,
|
||||||
'extra_caps': '{"extracap": "strong"}'
|
'extra_caps': '{"extracap": "strong"}'
|
||||||
}
|
}
|
||||||
|
|
||||||
res = self.client.post(CREATE_URL, form_data)
|
res = self.client.post(CREATE_URL, form_data)
|
||||||
self.assertNoFormErrors(res)
|
self.assertNoFormErrors(res)
|
||||||
self.assertMessageCount(success=(len(host_names) + 1))
|
self.assertMessageCount(success=(len(hv_hostnames) + 1))
|
||||||
self.assertRedirectsNoFollow(res, INDEX_URL)
|
self.assertRedirectsNoFollow(res, INDEX_URL)
|
||||||
|
|
||||||
@test.create_stubs({blazar_api.client: ('host_get', 'host_update')})
|
@test.create_stubs({blazar_api.client: ('host_get', 'host_update')})
|
||||||
|
@ -36,24 +36,18 @@ class SelectHostsAction(workflows.MembershipAction):
|
|||||||
field_name = self.get_member_field_name('member')
|
field_name = self.get_member_field_name('member')
|
||||||
self.fields[field_name] = forms.MultipleChoiceField(required=False)
|
self.fields[field_name] = forms.MultipleChoiceField(required=False)
|
||||||
|
|
||||||
|
hypervisors = []
|
||||||
|
blazar_hosts = []
|
||||||
try:
|
try:
|
||||||
nova_hosts = api.nova.host_list(request)
|
hypervisors = api.nova.hypervisor_list(request)
|
||||||
blazar_hosts = blazar_api.client.host_list(request)
|
blazar_hosts = blazar_api.client.host_list(request)
|
||||||
except Exception:
|
except Exception:
|
||||||
exceptions.handle(request, err_msg)
|
exceptions.handle(request, err_msg)
|
||||||
|
|
||||||
nova_hostnames = []
|
hv_hostnames = [hv.hypervisor_hostname for hv in hypervisors]
|
||||||
for host in nova_hosts:
|
blazar_hostnames = [host.hypervisor_hostname for host in blazar_hosts]
|
||||||
if (host.host_name not in nova_hostnames
|
|
||||||
and host.service == u'compute'):
|
|
||||||
nova_hostnames.append(host.host_name)
|
|
||||||
|
|
||||||
blazar_hostnames = []
|
host_names = list(set(hv_hostnames) - set(blazar_hostnames))
|
||||||
for host in blazar_hosts:
|
|
||||||
if host.hypervisor_hostname not in blazar_hostnames:
|
|
||||||
blazar_hostnames.append(host.hypervisor_hostname)
|
|
||||||
|
|
||||||
host_names = list(set(nova_hostnames) - set(blazar_hostnames))
|
|
||||||
host_names.sort()
|
host_names.sort()
|
||||||
|
|
||||||
self.fields[field_name].choices = \
|
self.fields[field_name].choices = \
|
||||||
|
@ -168,13 +168,12 @@ host_sample2 = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DummyNovaHost(object):
|
class DummyHypervisor(object):
|
||||||
def __init__(self, host_name, service):
|
def __init__(self, host_name):
|
||||||
self.host_name = host_name
|
self.hypervisor_hostname = host_name
|
||||||
self.service = service
|
|
||||||
|
|
||||||
novahost_sample1 = DummyNovaHost('compute-1', 'compute')
|
hypervisor_sample1 = DummyHypervisor('compute-1')
|
||||||
novahost_sample2 = DummyNovaHost('compute-2', 'compute')
|
hypervisor_sample2 = DummyHypervisor('compute-2')
|
||||||
|
|
||||||
|
|
||||||
def data(TEST):
|
def data(TEST):
|
||||||
@ -188,7 +187,7 @@ def data(TEST):
|
|||||||
TEST.hosts.add(api.client.Host(host_sample1))
|
TEST.hosts.add(api.client.Host(host_sample1))
|
||||||
TEST.hosts.add(api.client.Host(host_sample2))
|
TEST.hosts.add(api.client.Host(host_sample2))
|
||||||
|
|
||||||
TEST.novahosts = utils.TestDataContainer()
|
TEST.hypervisors = utils.TestDataContainer()
|
||||||
|
|
||||||
TEST.novahosts.add(novahost_sample1)
|
TEST.hypervisors.add(hypervisor_sample1)
|
||||||
TEST.novahosts.add(novahost_sample2)
|
TEST.hypervisors.add(hypervisor_sample2)
|
||||||
|
152
doc/Makefile
152
doc/Makefile
@ -1,152 +0,0 @@
|
|||||||
# Makefile for Sphinx documentation
|
|
||||||
|
|
||||||
# You can set these variables from the command line.
|
|
||||||
SPHINXOPTS =
|
|
||||||
SPHINXBUILD = sphinx-build
|
|
||||||
PAPER =
|
|
||||||
BUILDDIR = build
|
|
||||||
|
|
||||||
# Internal variables.
|
|
||||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
||||||
PAPEROPT_letter = -D latex_paper_size=letter
|
|
||||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
|
||||||
# the i18n builder cannot share the environment and doctrees with the others
|
|
||||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
|
||||||
|
|
||||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
|
||||||
|
|
||||||
help:
|
|
||||||
@echo "Please use \`make <target>' where <target> is one of"
|
|
||||||
@echo " html to make standalone HTML files"
|
|
||||||
@echo " dirhtml to make HTML files named index.html in directories"
|
|
||||||
@echo " singlehtml to make a single large HTML file"
|
|
||||||
@echo " pickle to make pickle files"
|
|
||||||
@echo " json to make JSON files"
|
|
||||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
||||||
@echo " qthelp to make HTML files and a qthelp project"
|
|
||||||
@echo " devhelp to make HTML files and a Devhelp project"
|
|
||||||
@echo " epub to make an epub"
|
|
||||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
||||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
||||||
@echo " text to make text files"
|
|
||||||
@echo " man to make manual pages"
|
|
||||||
@echo " texinfo to make Texinfo files"
|
|
||||||
@echo " info to make Texinfo files and run them through makeinfo"
|
|
||||||
@echo " gettext to make PO message catalogs"
|
|
||||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
||||||
@echo " linkcheck to check all external links for integrity"
|
|
||||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
|
||||||
|
|
||||||
clean:
|
|
||||||
-rm -rf $(BUILDDIR)/*
|
|
||||||
|
|
||||||
html:
|
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
||||||
|
|
||||||
dirhtml:
|
|
||||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
||||||
|
|
||||||
singlehtml:
|
|
||||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
||||||
|
|
||||||
pickle:
|
|
||||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the pickle files."
|
|
||||||
|
|
||||||
json:
|
|
||||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the JSON files."
|
|
||||||
|
|
||||||
htmlhelp:
|
|
||||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
|
||||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
|
||||||
|
|
||||||
qthelp:
|
|
||||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
|
||||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
|
||||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Blazar-dashboard.qhcp"
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Blazar-dashboard.qhc"
|
|
||||||
|
|
||||||
devhelp:
|
|
||||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished."
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/Blazar-dashboard"
|
|
||||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Blazar-dashboard"
|
|
||||||
@echo "# devhelp"
|
|
||||||
|
|
||||||
epub:
|
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
||||||
|
|
||||||
latex:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
||||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
|
||||||
"(use \`make latexpdf' here to do that automatically)."
|
|
||||||
|
|
||||||
latexpdf:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo "Running LaTeX files through pdflatex..."
|
|
||||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
||||||
|
|
||||||
text:
|
|
||||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
|
||||||
|
|
||||||
man:
|
|
||||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
|
||||||
|
|
||||||
texinfo:
|
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
|
||||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
|
||||||
"(use \`make info' here to do that automatically)."
|
|
||||||
|
|
||||||
info:
|
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
||||||
@echo "Running Texinfo files through makeinfo..."
|
|
||||||
make -C $(BUILDDIR)/texinfo info
|
|
||||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
|
||||||
|
|
||||||
gettext:
|
|
||||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
|
||||||
|
|
||||||
changes:
|
|
||||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
|
||||||
@echo
|
|
||||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
||||||
|
|
||||||
linkcheck:
|
|
||||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
|
||||||
@echo
|
|
||||||
@echo "Link check complete; look for any errors in the above output " \
|
|
||||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
||||||
|
|
||||||
doctest:
|
|
||||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
|
||||||
@echo "Testing of doctests in the sources finished, look at the " \
|
|
||||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
8
doc/requirements.txt
Normal file
8
doc/requirements.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# The order of packages is significant, because pip processes them in the order
|
||||||
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
|
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||||
|
sphinx!=1.6.6,>=1.6.2 # BSD
|
||||||
|
reno>=2.5.0 # Apache-2.0
|
||||||
|
sphinxcontrib-httpdomain>=1.3.0 # BSD
|
@ -22,144 +22,6 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import django
|
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
|
||||||
|
|
||||||
sys.path.insert(0, ROOT)
|
|
||||||
|
|
||||||
# This is required for ReadTheDocs.org, but isn't a bad idea anyway.
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
|
||||||
'blazar_dashboard.test.settings')
|
|
||||||
|
|
||||||
# Starting in Django 1.7, standalone scripts, such as a sphinx build
|
|
||||||
# require that django.setup() be called first.
|
|
||||||
# https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts
|
|
||||||
django.setup()
|
|
||||||
|
|
||||||
from blazar_dashboard import version as ui_ver
|
|
||||||
|
|
||||||
|
|
||||||
def write_autodoc_index():
|
|
||||||
|
|
||||||
def find_autodoc_modules(module_name, sourcedir):
|
|
||||||
"""returns a list of modules in the SOURCE directory."""
|
|
||||||
modlist = []
|
|
||||||
os.chdir(os.path.join(sourcedir, module_name))
|
|
||||||
print("SEARCHING %s" % sourcedir)
|
|
||||||
for root, dirs, files in os.walk("."):
|
|
||||||
for filename in files:
|
|
||||||
if filename == 'tests.py':
|
|
||||||
continue
|
|
||||||
if filename.endswith(".py"):
|
|
||||||
# remove the pieces of the root
|
|
||||||
elements = root.split(os.path.sep)
|
|
||||||
# replace the leading "." with the module name
|
|
||||||
elements[0] = module_name
|
|
||||||
# and get the base module name
|
|
||||||
base, extension = os.path.splitext(filename)
|
|
||||||
if not (base == "__init__"):
|
|
||||||
elements.append(base)
|
|
||||||
result = ".".join(elements)
|
|
||||||
# print result
|
|
||||||
modlist.append(result)
|
|
||||||
return modlist
|
|
||||||
|
|
||||||
RSTDIR = os.path.abspath(os.path.join(BASE_DIR, "sourcecode"))
|
|
||||||
SRCS = [('blazar_dashboard', ROOT), ]
|
|
||||||
|
|
||||||
EXCLUDED_MODULES = ()
|
|
||||||
CURRENT_SOURCES = {}
|
|
||||||
|
|
||||||
if not(os.path.exists(RSTDIR)):
|
|
||||||
os.mkdir(RSTDIR)
|
|
||||||
CURRENT_SOURCES[RSTDIR] = ['autoindex.rst']
|
|
||||||
|
|
||||||
INDEXOUT = open(os.path.join(RSTDIR, "autoindex.rst"), "w")
|
|
||||||
INDEXOUT.write("""
|
|
||||||
=================
|
|
||||||
Source Code Index
|
|
||||||
=================
|
|
||||||
|
|
||||||
.. contents::
|
|
||||||
:depth: 1
|
|
||||||
:local:
|
|
||||||
|
|
||||||
""")
|
|
||||||
|
|
||||||
for modulename, path in SRCS:
|
|
||||||
sys.stdout.write("Generating source documentation for %s\n" %
|
|
||||||
modulename)
|
|
||||||
INDEXOUT.write("\n%s\n" % modulename.capitalize())
|
|
||||||
INDEXOUT.write("%s\n" % ("=" * len(modulename),))
|
|
||||||
INDEXOUT.write(".. toctree::\n")
|
|
||||||
INDEXOUT.write(" :maxdepth: 1\n")
|
|
||||||
INDEXOUT.write("\n")
|
|
||||||
|
|
||||||
MOD_DIR = os.path.join(RSTDIR, modulename)
|
|
||||||
CURRENT_SOURCES[MOD_DIR] = []
|
|
||||||
if not(os.path.exists(MOD_DIR)):
|
|
||||||
os.mkdir(MOD_DIR)
|
|
||||||
for module in find_autodoc_modules(modulename, path):
|
|
||||||
if any([module.startswith(exclude) for exclude
|
|
||||||
in EXCLUDED_MODULES]):
|
|
||||||
print("Excluded module %s." % module)
|
|
||||||
continue
|
|
||||||
mod_path = os.path.join(path, *module.split("."))
|
|
||||||
generated_file = os.path.join(MOD_DIR, "%s.rst" % module)
|
|
||||||
|
|
||||||
INDEXOUT.write(" %s/%s\n" % (modulename, module))
|
|
||||||
|
|
||||||
# Find the __init__.py module if this is a directory
|
|
||||||
if os.path.isdir(mod_path):
|
|
||||||
source_file = ".".join((os.path.join(mod_path, "__init__"),
|
|
||||||
"py",))
|
|
||||||
else:
|
|
||||||
source_file = ".".join((os.path.join(mod_path), "py"))
|
|
||||||
|
|
||||||
CURRENT_SOURCES[MOD_DIR].append("%s.rst" % module)
|
|
||||||
# Only generate a new file if the source has changed or we don't
|
|
||||||
# have a doc file to begin with.
|
|
||||||
if not os.access(generated_file, os.F_OK) or (
|
|
||||||
os.stat(generated_file).st_mtime <
|
|
||||||
os.stat(source_file).st_mtime):
|
|
||||||
print("Module %s updated, generating new documentation."
|
|
||||||
% module)
|
|
||||||
FILEOUT = open(generated_file, "w")
|
|
||||||
header = "The :mod:`%s` Module" % module
|
|
||||||
FILEOUT.write("%s\n" % ("=" * len(header),))
|
|
||||||
FILEOUT.write("%s\n" % header)
|
|
||||||
FILEOUT.write("%s\n" % ("=" * len(header),))
|
|
||||||
FILEOUT.write(".. automodule:: %s\n" % module)
|
|
||||||
FILEOUT.write(" :members:\n")
|
|
||||||
FILEOUT.write(" :undoc-members:\n")
|
|
||||||
FILEOUT.write(" :show-inheritance:\n")
|
|
||||||
FILEOUT.write(" :noindex:\n")
|
|
||||||
FILEOUT.close()
|
|
||||||
|
|
||||||
INDEXOUT.close()
|
|
||||||
|
|
||||||
# Delete auto-generated .rst files for sources which no longer exist
|
|
||||||
for directory, subdirs, files in list(os.walk(RSTDIR)):
|
|
||||||
for old_file in files:
|
|
||||||
if old_file not in CURRENT_SOURCES.get(directory, []):
|
|
||||||
print("Removing outdated file for %s" % old_file)
|
|
||||||
os.remove(os.path.join(directory, old_file))
|
|
||||||
|
|
||||||
|
|
||||||
write_autodoc_index()
|
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
||||||
# sys.path.insert(0, os.path.abspath('.'))
|
|
||||||
|
|
||||||
# -- General configuration ----------------------------------------------------
|
# -- General configuration ----------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
@ -169,11 +31,14 @@ write_autodoc_index()
|
|||||||
# They can be extensions coming with Sphinx (named 'sphinx.ext.*')
|
# They can be extensions coming with Sphinx (named 'sphinx.ext.*')
|
||||||
# or your custom ones.
|
# or your custom ones.
|
||||||
extensions = ['sphinx.ext.autodoc',
|
extensions = ['sphinx.ext.autodoc',
|
||||||
'sphinx.ext.todo',
|
'openstackdocstheme',
|
||||||
'sphinx.ext.coverage',
|
|
||||||
'sphinx.ext.viewcode',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# openstackdocstheme options
|
||||||
|
repository_name = 'openstack/blazar-dashboard'
|
||||||
|
bug_project = 'blazar'
|
||||||
|
bug_tag = ''
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
# templates_path = ['_templates']
|
# templates_path = ['_templates']
|
||||||
|
|
||||||
@ -194,10 +59,11 @@ copyright = u'2017, OpenStack Foundation'
|
|||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
|
# Version info
|
||||||
|
from blazar_dashboard.version import version_info as blazar_dashboard_version
|
||||||
|
release = blazar_dashboard_version.release_string()
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = ui_ver.version_info.version_string()
|
version = blazar_dashboard_version.version_string()
|
||||||
# The full version, including alpha/beta/rc tags.
|
|
||||||
release = ui_ver.version_info.release_string()
|
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
@ -226,7 +92,7 @@ exclude_patterns = ['**/#*', '**~', '**/#*#']
|
|||||||
|
|
||||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||||
# output. They are ignored by default.
|
# output. They are ignored by default.
|
||||||
show_authors = False
|
# show_authors = False
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
pygments_style = 'sphinx'
|
pygments_style = 'sphinx'
|
||||||
@ -234,15 +100,12 @@ pygments_style = 'sphinx'
|
|||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
# modindex_common_prefix = []
|
# modindex_common_prefix = []
|
||||||
|
|
||||||
primary_domain = 'py'
|
|
||||||
nitpicky = False
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output --------------------------------------------------
|
# -- Options for HTML output --------------------------------------------------
|
||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
html_theme = 'default'
|
html_theme = 'openstackdocs'
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
# further. For a list of options available for each theme, see the
|
# further. For a list of options available for each theme, see the
|
||||||
@ -314,124 +177,4 @@ html_last_updated_fmt = '%Y-%m-%d %H:%M'
|
|||||||
# html_file_suffix = None
|
# html_file_suffix = None
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = 'Horizondoc'
|
htmlhelp_basename = 'Blazardashboarddoc'
|
||||||
|
|
||||||
|
|
||||||
# -- Options for LaTeX output -------------------------------------------------
|
|
||||||
|
|
||||||
latex_elements = {
|
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
|
||||||
# 'papersize': 'letterpaper',
|
|
||||||
|
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
|
||||||
# 'pointsize': '10pt',
|
|
||||||
|
|
||||||
# Additional stuff for the LaTeX preamble.
|
|
||||||
# 'preamble': '',
|
|
||||||
}
|
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
|
||||||
# (source start file, target name, title, author, documentclass
|
|
||||||
# [howto/manual]).
|
|
||||||
latex_documents = [
|
|
||||||
('index', 'Horizon.tex', u'Horizon Documentation',
|
|
||||||
u'OpenStack Foundation', 'manual'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
|
||||||
# the title page.
|
|
||||||
# latex_logo = None
|
|
||||||
|
|
||||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
||||||
# not chapters.
|
|
||||||
# latex_use_parts = False
|
|
||||||
|
|
||||||
# If true, show page references after internal links.
|
|
||||||
# latex_show_pagerefs = False
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
# latex_show_urls = False
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
# latex_appendices = []
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
# latex_domain_indices = True
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for manual page output -------------------------------------------
|
|
||||||
|
|
||||||
# One entry per manual page. List of tuples
|
|
||||||
# (source start file, name, description, authors, manual section).
|
|
||||||
man_pages = [
|
|
||||||
('index', u'Blazar dashboard Documentation',
|
|
||||||
'Documentation for the Blazar dashboard plugin to the OpenStack '
|
|
||||||
'Dashboard (Horizon)',
|
|
||||||
[u'OpenStack'], 1)
|
|
||||||
]
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
# man_show_urls = False
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Texinfo output -----------------------------------------------
|
|
||||||
|
|
||||||
# Grouping the document tree into Texinfo files. List of tuples
|
|
||||||
# (source start file, target name, title, author,
|
|
||||||
# dir menu entry, description, category)
|
|
||||||
texinfo_documents = [
|
|
||||||
('index', 'Horizon', u'Horizon Documentation', u'OpenStack',
|
|
||||||
'Horizon', 'One line description of project.', 'Miscellaneous'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
# texinfo_appendices = []
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
# texinfo_domain_indices = True
|
|
||||||
|
|
||||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
|
||||||
# texinfo_show_urls = 'footnote'
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Epub output --------------------------------------------------
|
|
||||||
|
|
||||||
# Bibliographic Dublin Core info.
|
|
||||||
epub_title = u'Horizon'
|
|
||||||
epub_author = u'OpenStack'
|
|
||||||
epub_publisher = u'OpenStack'
|
|
||||||
epub_copyright = u'2012, OpenStack'
|
|
||||||
|
|
||||||
# The language of the text. It defaults to the language option
|
|
||||||
# or en if the language is not set.
|
|
||||||
# epub_language = ''
|
|
||||||
|
|
||||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
|
||||||
# epub_scheme = ''
|
|
||||||
|
|
||||||
# The unique identifier of the text. This can be an ISBN number
|
|
||||||
# or the project homepage.
|
|
||||||
# epub_identifier = ''
|
|
||||||
|
|
||||||
# A unique identification for the text.
|
|
||||||
# epub_uid = ''
|
|
||||||
|
|
||||||
# A tuple containing the cover image and cover page html template filenames.
|
|
||||||
# epub_cover = ()
|
|
||||||
|
|
||||||
# HTML files that should be inserted before the pages created by sphinx.
|
|
||||||
# The format is a list of tuples containing the path and title.
|
|
||||||
# epub_pre_files = []
|
|
||||||
|
|
||||||
# HTML files shat should be inserted after the pages created by sphinx.
|
|
||||||
# The format is a list of tuples containing the path and title.
|
|
||||||
# epub_post_files = []
|
|
||||||
|
|
||||||
# A list of files that should not be packed into the epub file.
|
|
||||||
# epub_exclude_files = []
|
|
||||||
|
|
||||||
# The depth of the table of contents in toc.ncx.
|
|
||||||
# epub_tocdepth = 3
|
|
||||||
|
|
||||||
# Allow duplicate toc entries.
|
|
||||||
# epub_tocdup = True
|
|
||||||
|
@ -1,47 +1,38 @@
|
|||||||
================
|
================
|
||||||
Blazar dashboard
|
Blazar Dashboard
|
||||||
================
|
================
|
||||||
|
|
||||||
Horizon plugin for the Blazar Reservation Service for OpenStack
|
Blazar Dashboard is a Horizon plugin for the Blazar Reservation service.
|
||||||
|
|
||||||
* Free software: Apache license
|
* Free software: Apache license
|
||||||
* Source: https://git.openstack.org/cgit/openstack/blazar-dashboard
|
* Source: https://git.openstack.org/cgit/openstack/blazar-dashboard
|
||||||
* Bugs: https://bugs.launchpad.net/blazar
|
* Bugs: https://bugs.launchpad.net/blazar
|
||||||
|
|
||||||
Features
|
Overview
|
||||||
--------
|
========
|
||||||
|
|
||||||
The following features are currently supported:
|
The following features are currently supported:
|
||||||
|
|
||||||
* Leases panel in the Reservations group of the Project dashboard
|
* Leases panel in the Reservations group of the Project dashboard
|
||||||
|
|
||||||
* Show a list of leases
|
* Show a list of leases
|
||||||
* Show details of a lease
|
* Show details of a lease
|
||||||
* Create a lease
|
* Create a lease
|
||||||
* Update a lease
|
* Update a lease
|
||||||
* Delete lease(s)
|
* Delete lease(s)
|
||||||
|
|
||||||
* Hosts panel in the Reservation group of the Admin dashboard
|
* Hosts panel in the Reservation group of the Admin dashboard
|
||||||
|
|
||||||
* Show a list of hosts
|
* Show a list of hosts
|
||||||
* Show details of a host
|
* Show details of a host
|
||||||
* Create host(s)
|
* Create host(s)
|
||||||
* Update a host
|
* Update a host
|
||||||
* Delete host(s)
|
* Delete host(s)
|
||||||
|
|
||||||
Using Blazar dashboard
|
Installation Guide
|
||||||
----------------------
|
==================
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
install
|
install/index
|
||||||
|
|
||||||
Source Code Reference
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:glob:
|
|
||||||
:maxdepth: 1
|
|
||||||
|
|
||||||
sourcecode/autoindex
|
|
||||||
|
7
doc/source/install/index.rst
Normal file
7
doc/source/install/index.rst
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
===================================
|
||||||
|
Blazar Dashboard Installation Guide
|
||||||
|
===================================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
install.rst
|
@ -3,12 +3,12 @@ Installation
|
|||||||
============
|
============
|
||||||
|
|
||||||
Enabling in DevStack
|
Enabling in DevStack
|
||||||
--------------------
|
====================
|
||||||
|
|
||||||
* Not yet supported
|
* Not yet supported
|
||||||
|
|
||||||
Manual Installation
|
Manual Installation
|
||||||
-------------------
|
===================
|
||||||
|
|
||||||
Begin by cloning the Horizon and Blazar dashboard repositories::
|
Begin by cloning the Horizon and Blazar dashboard repositories::
|
||||||
|
|
@ -13,4 +13,4 @@ Django<2.0,>=1.8 # BSD
|
|||||||
django-babel>=0.5.1 # BSD
|
django-babel>=0.5.1 # BSD
|
||||||
django-compressor>=2.0 # MIT
|
django-compressor>=2.0 # MIT
|
||||||
django-pyscss>=2.0.2 # BSD License (2 clause)
|
django-pyscss>=2.0.2 # BSD License (2 clause)
|
||||||
http://tarballs.openstack.org/python-blazarclient/python-blazarclient-master.tar.gz#egg=python-blazarclient
|
python-blazarclient>=1.0.0 # Apache-2.0
|
||||||
|
@ -19,6 +19,4 @@ nose-exclude>=0.3.0 # LGPL
|
|||||||
nosehtmloutput>=0.0.3 # Apache-2.0
|
nosehtmloutput>=0.0.3 # Apache-2.0
|
||||||
nosexcover>=1.0.10 # BSD
|
nosexcover>=1.0.10 # BSD
|
||||||
openstack.nose-plugin>=0.7 # Apache-2.0
|
openstack.nose-plugin>=0.7 # Apache-2.0
|
||||||
reno>=2.5.0 # Apache-2.0
|
|
||||||
sphinx>=1.6.2 # BSD
|
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
|
2
tox.ini
2
tox.ini
@ -65,9 +65,11 @@ commands =
|
|||||||
npm run lint
|
npm run lint
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user