Statistics
| Branch: | Tag: | Revision:

root / lib / build / sphinx_ext.py @ 966e1580

History | View | Annotate | Download (16.8 kB)

# Date Author Comment
4f73cfc9 03/08/2013 05:46 pm Iustin Pop

Merge branch 'devel-2.7'

  • devel-2.7:
    Change hbal behaviour in case of early exit
    Fix build/sphinx_ext.py with tuple defaults for op params
    Fix bug in man build rule
    Fix hscolour style sheet building

Signed-off-by: Iustin Pop <>...

c83c0410 03/06/2013 04:37 pm Iustin Pop

Fix build/sphinx_ext.py with tuple defaults for op params

When an OpCode's parameter has a tuple as default value, this code
will break:

buf.write("defaults to ``%s``" % default)

The patch fixes this and other potential cases by always passing a
tuple to '%'....

d59633a6 02/25/2013 02:13 pm Michael Hanselmann

sphinx_ext: New directive for supported methods

Until now many resources, but not all and not consistently list their
supported methods (e.g. “Supports the following commands: ``GET`` …”).
Not only is it easy for this list to get out of date, but it would also...

aa82eb62 02/25/2013 02:13 pm Michael Hanselmann

sphinx_ext: Factorize getting RAPI handlers

The list of resources and handlers will also be used for generating
a per-resource table.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

60b47261 02/25/2013 02:13 pm Michael Hanselmann

sphinx_ext: Factorize handler methods/access

The factorized parts will be used to show a small table with methods and
required permissions for each resource.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

61c13f94 02/25/2013 02:13 pm Michael Hanselmann

Use "none" instead of "everyone" in RAPI documentation

The list of required access permissions uses the word “everyone” to mean
“no special permissions are needed”. The word “none” fits better.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

1302ce18 02/22/2013 12:51 pm Michael Hanselmann

Improve RAPI documentation on users and options

- Document fields in “rapi/users” file in the order they appear
(username, password, options)
- Mention new “--require-authentication” option
- Clarify use of “write” on “GET” method

Signed-off-by: Michael Hanselmann <>...

5d0b2888 02/22/2013 12:51 pm Michael Hanselmann

sphinx_ext: Drop text map for RAPI permissions

Other parts of the documentation directly refer to the constants through
“pyeval”. There's no need for this map as it's just additional work to
maintain.

Signed-off-by: Michael Hanselmann <>...

daff2f81 02/20/2013 01:28 pm Michael Hanselmann

Build table with access permissions for RAPI resources

Sometimes it can be difficult to determine the access permissions needed
for a certain RAPI resource without looking at code. This table, added
at the end of “rapi.rst”, shows all resources and the permissions needed...

46ab58d4 02/19/2013 04:29 pm Michael Hanselmann

RAPI documentation: Assertion for console fields

Assert that the documented fields are equal to those in the actual
object.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

c6793656 02/19/2013 04:29 pm Michael Hanselmann

Sphinx extension: Module-level constant for tab width

Use a module-level constant for the tab width.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

5ce58234 01/15/2013 04:43 pm Michael Hanselmann

Link man pages in documentation

This patch depends on “Option to include man pages in documentation”. In
the documentation build including man pages, all “:manpage:`…`”
references are converted to links. For man pages not provided by Ganeti,
Sphinx' standard formatting is used....

a12f0ef8 11/09/2012 03:35 pm Michael Hanselmann

sphinx_ext: Allow use of “rapi” module in pyeval

This way constants like “rapi.RAPI_ACCESS_WRITE” can be used in
documentation.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

2ed0e208 07/27/2012 12:16 pm Iustin Pop

Fix 'explicitely' common typo

It seems that 'explicitely' is wrong, and that the right form is
'explicitly'. This is just fixing the typo plus adjusting affected
paragraphs.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

12e0ee0d 03/30/2012 03:03 pm Michael Hanselmann

NEWS: Deprecate LUXI calls replaced with query2

Adding the “luxi” namespace is necessary in “sphinx_ext”.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

d505bc48 02/13/2012 08:04 pm Iustin Pop

Fix doc bug introduced in 12637df

Commit 12637df changed/generalised how we build fields in the sphinx
extension, however it resulted in this uncaught-so-far result:

$ echo QUERY_FIELDS_GROUP | ./autotools/docpp
<generator object BuildValuesDoc at 0x28fd370>...

a19a6326 12/13/2011 02:00 pm Michael Hanselmann

sphinx_ext: No longer exclude “depends” parameter by default

By default parameters existing for all opcodes (e.g. “debug_level”) are
not listed in the RAPI documentation. With this change the “depends”
parameter will be listed unless explicitely excluded....

12637df5 10/07/2011 02:19 pm Andrea Spadaccini

Generalize docpp and sphinx_ext

autotools/docpp
  • handle generic custom directives in the form <class>_<kind>
  • adapt handling of query fields
build/sphinx_ext.py
  • add the BuildValuesDoc function to output definitions using the sphinx
    syntax that was already used for query fields...
3ac3f5e4 10/07/2011 02:19 pm Andrea Spadaccini

Add error codes documentation

lib/constants.py
  • add to each CV_E* tuple the documentation of the error code
  • add the DOCUMENTED_CONSTANTS constant for the doc preprocessor
autotools/docpp
  • add a new directive class CONSTANTS_<kind>, that gets data from...
b459a848 08/30/2011 11:24 am Andrea Spadaccini

DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst)....

b6d02fa9 08/19/2011 05:55 pm Iustin Pop

sphinx_ext: workaround epydoc warning

Similar to commit c29e35f, this works around epydoc breakage by
aliasing the module. Makes 'apidoc' pass again on my machine.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

f96c51a0 08/12/2011 03:49 pm Michael Hanselmann

sphinx_ext: Allow documenting opcode results

Will be used by RAPI documentation.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

a4338da2 08/03/2011 05:41 pm Iustin Pop

Fix lint errors

It turns out that the only use of the operator module was for
itemgetter, so patch eb62069e should have removed that import too.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

eb62069e 08/03/2011 01:37 pm Iustin Pop

Add two more compat functions

operator.itemgetter(0) → fst
operator.itemgetter(1) → snd

snd is not used yet, but it makes sense to add both.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

a5566394 07/06/2011 05:37 pm Michael Hanselmann

Fix lint error

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

b4fcee5b 07/06/2011 12:31 am Michael Hanselmann

RAPI: Document all feature strings

- Use constants and an assertion
- Update documentation for node migration

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

111bf531 03/01/2011 03:31 pm Michael Hanselmann

Add query field flags

Some fields (e.g. “name”) should be treated specially when comparing for
equality. Hypervisor names should use normal rules, but for node names,
“node2” should be equivalent with “node2.example.com”.

To make these differences, a new field for flags is added to the query...

95eb4188 02/24/2011 03:25 pm Michael Hanselmann

Add script to generate query fields documentation

- All lines matching "QUERY_FIELDS_${resource}" in the input will be
replaced with a definition list describing the fields for $resource
- The core code is kept in the Sphinx extension, so that it could be...

cbb86b63 02/16/2011 02:11 pm Michael Hanselmann

Fix build error when using docutils 0.4

Docutils 0.4 doesn't provide the “Directive” class and Sphinx supplies
its own version which doesn't have the “assert_has_content” method.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

1aa50158 02/15/2011 04:14 pm Michael Hanselmann

Add pylint disables to Sphinx extension

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

685d3b42 02/15/2011 03:20 pm Michael Hanselmann

Sphinx extension: Allow evaluation of Python expressions

There are quite many hardcoded constants (e.g. “[…] one of ``file``,
``lvm-pv`` or ``lvm-vg`` […]). By using constants it'll be easier to
identify these.

With such lists of values it's also easy to miss some when...

dac59ac5 02/15/2011 03:20 pm Michael Hanselmann

Sphinx extension: Don't use “from … import …”

Import with full name instead to reduce potential conflicts.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5f43f393 02/04/2011 07:05 pm Michael Hanselmann

Add sphinx extension

For now this just registers a single new directive, “opcode_params”,
which can be used to generate opcode parameter documentation.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>