oslo.config/oslo
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
..
config Add the ability to validate default options value 2013-10-09 10:30:52 +02:00
__init__.py Add oslo-config project infrastructure 2013-01-21 09:58:17 +00:00