OpenStack library for config
Go to file
Julien Danjou a289afed93 Add the ability to validate default options value
Currently, the default options value provided are not validated, which
can trigger fun things like a IntOpt having a "foobar" as default value,
with code failing later when the option is being used.

This patch introduces a _validate_value method that can be used to
validate the default value to the expected type.

ConfigOpts.__call__ gains a validate_default_values arguments that can
trigger default value validation. The argument is False by default in
order to not break existing code.

Ultimately, we could in a later version validate the default at Opt
object creation time, which would be much better, but that may break
existing code, so we'll see.

Change-Id: I6c1998a3be3f1579139317cd85d56b42cabf89db
2013-10-09 10:30:52 +02:00
doc/source Release notes for 1.2.0 2013-09-23 15:55:30 +01:00
oslo Add the ability to validate default options value 2013-10-09 10:30:52 +02:00
tests Add the ability to validate default options value 2013-10-09 10:30:52 +02:00
.gitignore Add eclipse project files to .gitignore 2013-07-18 22:40:46 +00:00
.gitreview Rename oslo-config to oslo.config. 2013-03-14 12:04:19 -07:00
.testr.conf Upgrade testing to use testr. 2013-05-03 17:26:07 -04:00
CONTRIBUTING.rst Update build to use pbr. 2013-05-03 12:38:15 -04:00
LICENSE Add LICENSE file 2013-02-17 09:25:32 +00:00
MANIFEST.in Tar up .testr.conf as well 2013-06-13 10:39:54 +02:00
README.rst Update build to use pbr. 2013-05-03 12:38:15 -04:00
requirements.txt Rename tools/(pip|test)-requires to *requirements.txt 2013-06-13 10:20:30 +02:00
setup.cfg Remove explicit version from setup.cfg 2013-08-25 12:51:31 +01:00
setup.py Updated from global requirements 2013-10-01 16:14:25 +00:00
test-requirements.txt Update requirements 2013-08-26 17:18:39 +02:00
tox.ini Fix python 3.3 test configuration 2013-07-22 15:19:29 -04:00

Oslo Configuration Library

The Oslo configuration API supports parsing command line arguments and .ini style configuration files.