summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-01-08 21:48:11 +0000
committerMark McLoughlin <markmc@redhat.com>2013-01-08 21:50:04 +0000
commita8973c524c9fe901972ba61f34dafac7438417c9 (patch)
tree032e259a4a26d201c531bc0293047a01659bac09
parentb17b268a269c4989d76267db5c2d49d4c20bd51d (diff)
downloadoslo-a8973c524c9fe901972ba61f34dafac7438417c9.tar.gz
oslo-a8973c524c9fe901972ba61f34dafac7438417c9.tar.xz
oslo-a8973c524c9fe901972ba61f34dafac7438417c9.zip
Revert "Support lookup of value using "group.key""
This reverts commit 525ac47. There are already two ways to reference an option in a group: CONF.group.key CONF[group].key Adding a third variant doesn't seem ideal. Also, for the specific case of LazyPluggable in Nova, we can easily just pass an optional config group name to the constructor. Change-Id: I1a29a18d90e8af3ce2563bd1b3eeb64422140016
-rw-r--r--openstack/common/cfg.py6
-rw-r--r--tests/unit/test_cfg.py6
2 files changed, 1 insertions, 11 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py
index 333a34b..8f25c5c 100644
--- a/openstack/common/cfg.py
+++ b/openstack/common/cfg.py
@@ -1567,11 +1567,7 @@ class ConfigOpts(collections.Mapping):
opts = group._opts
if not opt_name in opts:
- 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)
+ raise NoSuchOptError(opt_name, group)
return opts[opt_name]
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py
index 2da085a..ff24c0c 100644
--- a/tests/unit/test_cfg.py
+++ b/tests/unit/test_cfg.py
@@ -1120,12 +1120,6 @@ class OverridesTestCase(BaseTestCase):
self.conf.clear_override('foo', group='blaa')
self.assertEquals(self.conf.blaa.foo, None)
- def test_group_get_group_option(self):
- self.conf.register_group(OptGroup('blaa'))
- self.conf.register_opt(StrOpt('foo', default='foo2'), group='blaa')
- self.conf([])
- self.assertEquals(self.conf['blaa.foo'], 'foo2')
-
def test_cli_bool_default(self):
self.conf.register_cli_opt(BoolOpt('foo'))
self.conf.set_default('foo', True)