diff options
| author | Davanum Srinivas <dims@linux.vnet.ibm.com> | 2012-12-26 22:50:35 -0500 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-02 19:12:44 +0000 |
| commit | 525ac47bb934621057904725376108f56f6c57fe (patch) | |
| tree | 9a1ec3260e559e7bd09d5bad91f87c7b572f033e /openstack/common | |
| parent | ffeb0855085617095f19296770a1223cb5641d1c (diff) | |
| download | oslo-525ac47bb934621057904725376108f56f6c57fe.tar.gz oslo-525ac47bb934621057904725376108f56f6c57fe.tar.xz oslo-525ac47bb934621057904725376108f56f6c57fe.zip | |
Support lookup of value using "group.key"
Let us check if the opt_name has a '.', if it does then split it
into a group/key and try lookup using that combination. Since
LazyPluggable uses "CONF[self.__pivot]" if we just add this
capability to cfg, we get "LazyPluggable doesn't support
option groups" for free.
Fixes LP #1093043
Change-Id: I9cedcf22014038e9fe4ed5e66ca5427aa99b5091
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/cfg.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index 8f25c5c..333a34b 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -1567,7 +1567,11 @@ class ConfigOpts(collections.Mapping): opts = group._opts if not opt_name in opts: - raise NoSuchOptError(opt_name, group) + if group is None and '.' in opt_name: + group, opt_name = opt_name.split('.') + return self._get_opt_info(opt_name, group) + else: + raise NoSuchOptError(opt_name, group) return opts[opt_name] |
