Add oslo.config.opts entry_points in setup.cfg

oslo-config-generator relies on these entry_points listed
in setup.cfg to add options to the generated sample conf
files in different projects. So we should expose options
in oslo.log.

Closes-Bug: #1391742
Change-Id: I7c339484f17c4067ad7c82eb7f7208ef6d8be417
This commit is contained in:
Davanum Srinivas
2014-11-12 12:47:03 -05:00
parent 320b1c08c4
commit 54fb3269c0
2 changed files with 26 additions and 0 deletions

View File

@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import copy
from oslo.config import cfg
_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
@@ -130,3 +132,23 @@ log_opts = [
help='The format for an instance UUID that is passed with the '
'log message.'),
]
def list_opts():
"""Returns a list of oslo.config options available in the library.
The returned list includes all oslo.config options which may be registered
at runtime by the library.
Each element of the list is a tuple. The first element is the name of the
group under which the list of elements in the second element will be
registered. A group name of None corresponds to the [DEFAULT] group in
config files.
The purpose of this is to allow tools like the Oslo sample config file
generator to discover the options exposed to users by this library.
:returns: a list of (group_name, opts) tuples
"""
return [(None, copy.deepcopy(common_cli_opts + logging_cli_opts +
generic_log_opts + log_opts))]

View File

@@ -28,6 +28,10 @@ namespace_packages =
[pbr]
warnerrors = true
[entry_points]
oslo.config.opts =
oslo.log = oslo.log._options:list_opts
[build_sphinx]
source-dir = doc/source
build-dir = doc/build