diff --git a/doc/source/conf.py b/doc/source/conf.py index b9b4d46..cff3f2e 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,7 +23,8 @@ sys.path.insert(0, os.path.abspath('../..')) extensions = [ 'sphinx.ext.autodoc', #'sphinx.ext.intersphinx', - 'oslosphinx' + 'oslosphinx', + 'oslo_config.sphinxext', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy diff --git a/doc/source/index.rst b/doc/source/index.rst index bd11097..94dc98e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -22,6 +22,7 @@ Contents installation api/index usage + opts contributing Release Notes diff --git a/doc/source/opts.rst b/doc/source/opts.rst new file mode 100644 index 0000000..f6449ab --- /dev/null +++ b/doc/source/opts.rst @@ -0,0 +1,9 @@ +======================= + Configuration Options +======================= + +oslo.versionedobjects uses oslo.config to define and manage +configuration options to allow the deployer to control how an +application using oslo.versionedobjects behaves. + +.. show-options:: oslo.versionedobjects diff --git a/oslo_versionedobjects/_options.py b/oslo_versionedobjects/_options.py new file mode 100644 index 0000000..a54dfcc --- /dev/null +++ b/oslo_versionedobjects/_options.py @@ -0,0 +1,34 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import copy + +from oslo_versionedobjects import exception + + +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 [('oslo_versionedobjects', copy.deepcopy(exception.exc_log_opts))] diff --git a/setup.cfg b/setup.cfg index 9510680..f1c6c48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,10 @@ classifier = packages = oslo_versionedobjects +[entry_points] +oslo.config.opts = + oslo.versionedobjects = oslo_versionedobjects._options:list_opts + [extras] fixtures = mock>=1.2