summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2012-12-26 22:50:35 -0500
committerGerrit Code Review <review@openstack.org>2013-01-02 19:12:44 +0000
commit525ac47bb934621057904725376108f56f6c57fe (patch)
tree9a1ec3260e559e7bd09d5bad91f87c7b572f033e /openstack
parentffeb0855085617095f19296770a1223cb5641d1c (diff)
downloadoslo-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')
-rw-r--r--openstack/common/cfg.py6
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]