summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-11-19 18:55:46 +0000
committerGerrit Code Review <review@openstack.org>2014-11-19 18:55:46 +0000
commitb8fc3c6eee9cb7500bd237a35678a067be782c79 (patch)
tree8149c438aeba4466b6e33d7f5d65202e60bd5155
parent8b1de939f76b603777147bea86ba40008752aca2 (diff)
parent54fb3269c06a728322bf82ce7f09eee403229fac (diff)
downloadoslo-log-b8fc3c6eee9cb7500bd237a35678a067be782c79.tar.gz
Merge "Add oslo.config.opts entry_points in setup.cfg"
-rw-r--r--oslo/log/_options.py22
-rw-r--r--setup.cfg4
2 files changed, 26 insertions, 0 deletions
diff --git a/oslo/log/_options.py b/oslo/log/_options.py
index a730b93..6ded595 100644
--- a/oslo/log/_options.py
+++ b/oslo/log/_options.py
@@ -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))]
diff --git a/setup.cfg b/setup.cfg
index 15f7261..786ef4e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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