diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-09-08 20:33:24 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-09-08 20:33:24 +0000 |
commit | 83236b0d7dbdbaa5c2ebe73925ee0f1928d16aff (patch) | |
tree | a87ef142280612cb63d4a2908b0a161d8424e510 | |
parent | e5a6e198a9a906378e48669d73c8eadea5c8d2cb (diff) | |
parent | 10fa16906e91b94f40ff68d00544c70cb975c857 (diff) | |
download | oslo-config-83236b0d7dbdbaa5c2ebe73925ee0f1928d16aff.tar.gz |
Merge "Explain groups for DeprecatedOpts"
-rw-r--r-- | oslo/config/cfg.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/oslo/config/cfg.py b/oslo/config/cfg.py index 0ff708e..f41264a 100644 --- a/oslo/config/cfg.py +++ b/oslo/config/cfg.py @@ -835,6 +835,18 @@ class DeprecatedOpt(object): deprecated options are present, the option corresponding to the first element of deprecated_opts will be chosen. + If group is None, the DeprecatedOpt lookup will happen within the same + group the new option is in. For example:: + + oldopts = [cfg.DeprecatedOpt('oldfoo'), + cfg.DeprecatedOpt('oldfoo2', group='DEFAULT')] + + cfg.CONF.register_group(cfg.OptGroup('blaa')) + cfg.CONF.register_opt(cfg.StrOpt('foo', deprecated_opts=oldopts), + group='blaa') + + In the example above, `oldfoo` will be looked up in the `blaa` group and + `oldfoo2` in the `DEFAULT` group. """ def __init__(self, name, group=None): |