Merge "Use versionadded and versionchanged in doc"

This commit is contained in:
Jenkins
2015-11-05 20:57:57 +00:00
committed by Gerrit Code Review
5 changed files with 47 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ namespaces::
$> oslo-config-generator --namespace myapp --namespace oslo.messaging > myapp.conf
.. versionadded:: 1.4
Defining Option Discovery Entry Points
--------------------------------------

View File

@@ -678,6 +678,15 @@ class Opt(object):
a string explaining how the option's value is used
.. versionchanged:: 1.2
Added *deprecated_opts* parameter.
.. versionchanged:: 1.4
Added *sample_default* parameter.
.. versionchanged:: 1.9
Added *deprecated_for_removal* parameter.
.. versionchanged:: 2.7
An exception is now raised if the default value has the wrong type.
@@ -954,6 +963,8 @@ class DeprecatedOpt(object):
Then the value of "[group1]/opt1" will be ['val11', 'val12', 'val21',
'val22'].
.. versionadded:: 1.2
"""
def __init__(self, name, group=None):
@@ -1073,6 +1084,10 @@ class IntOpt(Opt):
Option with ``type`` :class:`oslo_config.types.Integer`
`Kept for backward-compatibility with options not using Opt directly`.
.. versionchanged:: 1.15
Added *min* and *max* parameters.
"""
def __init__(self, name, min=None, max=None, **kwargs):
@@ -1100,6 +1115,9 @@ class ListOpt(Opt):
Option with ``type`` :class:`oslo_config.types.List`
`Kept for backward-compatibility with options not using Opt directly`.
.. versionchanged:: 2.5
Added *item_type* and *bounds* parameters.
"""
def __init__(self, name, item_type=None, bounds=None, **kwargs):
@@ -1116,6 +1134,8 @@ class DictOpt(Opt):
Option with ``type`` :class:`oslo_config.types.Dict`
`Kept for backward-compatibility with options not using Opt directly`.
.. versionadded:: 1.2
"""
def __init__(self, name, **kwargs):
@@ -1130,6 +1150,8 @@ class IPOpt(Opt):
:param version: one of either ``4``, ``6``, or ``None`` to specify
either version.
.. versionadded:: 1.4
"""
def __init__(self, name, version=None, **kwargs):
@@ -1169,6 +1191,8 @@ class MultiOpt(Opt):
The command line ``--foo=1 --foo=2`` would result in ``cfg.CONF.foo``
containing ``[1,2]``
.. versionadded:: 1.3
"""
multi = True
@@ -1271,6 +1295,8 @@ class _ConfigFileOpt(Opt):
This allows us to properly handle the precedence of --config-file
options over previous command line arguments, but not over subsequent
arguments.
.. versionadded:: 1.2
"""
class ConfigFileAction(argparse.Action):
@@ -1317,6 +1343,8 @@ class _ConfigDirOpt(Opt):
_Namespace object. This allows us to properly handle the precedence of
--config-dir options over previous command line arguments, but not
over subsequent arguments.
.. versionadded:: 1.2
"""
class ConfigDirAction(argparse.Action):

View File

@@ -24,6 +24,8 @@ There are three use cases for the ConfigFilter class:
3. Limit the options on a Cfg object that can be accessed.
.. versionadded:: 1.4
Cross-Module Option Dependencies
--------------------------------
@@ -121,8 +123,6 @@ we can expose options such that only those options are present::
print(restricted_conf.foo)
print(restricted_conf.bar) # raises NoSuchOptError
"""
import collections
@@ -132,7 +132,10 @@ from oslo_config import cfg
class CliOptRegisteredError(cfg.Error):
"""Raised when registering cli opt not in original ConfigOpts."""
"""Raised when registering cli opt not in original ConfigOpts.
.. versionadded:: 1.12
"""
def __str__(self):
ret = "Cannot register a cli option that was not present in the" \

View File

@@ -20,6 +20,7 @@
Tool for generating a sample configuration file. See
../doc/source/generator.rst for details.
.. versionadded:: 1.4
"""
import logging

View File

@@ -17,6 +17,7 @@
Use these classes as values for the `type` argument to
:class:`oslo_config.cfg.Opt` and its subclasses.
.. versionadded:: 1.3
"""
import re
@@ -47,6 +48,12 @@ class String(ConfigType):
:param ignore_case: If True case differences (uppercase vs. lowercase)
between 'choices' or 'regex' will be ignored;
defaults to False.
.. versionchanged:: 2.1
Added *regex* parameter.
.. versionchanged:: 2.5
Added *ignore_case* parameter.
"""
def __init__(self, choices=None, quotes=False, regex=None,
@@ -161,6 +168,9 @@ class Integer(ConfigType):
:param min: Optional check that value is greater than or equal to min
:param max: Optional check that value is less than or equal to max
.. versionchanged:: 2.4
The class now honors zero for *min* and *max* parameters.
"""
def __init__(self, min=None, max=None):