Merge "Use cfg's new behavior of reset() clearing overrides"
This commit is contained in:
commit
7fbb4d225f
@ -147,29 +147,15 @@ class TestCase(unittest.TestCase):
|
|||||||
if path in sys.path:
|
if path in sys.path:
|
||||||
sys.path.remove(path)
|
sys.path.remove(path)
|
||||||
kvs.INMEMDB.clear()
|
kvs.INMEMDB.clear()
|
||||||
self.reset_opts()
|
CONF.reset()
|
||||||
|
|
||||||
def opt_in_group(self, group, **kw):
|
def opt_in_group(self, group, **kw):
|
||||||
for k, v in kw.iteritems():
|
for k, v in kw.iteritems():
|
||||||
CONF.set_override(k, v, group)
|
CONF.set_override(k, v, group)
|
||||||
if group not in self._group_overrides:
|
|
||||||
self._group_overrides[group] = []
|
|
||||||
self._group_overrides[group].append(k)
|
|
||||||
|
|
||||||
def opt(self, **kw):
|
def opt(self, **kw):
|
||||||
for k, v in kw.iteritems():
|
for k, v in kw.iteritems():
|
||||||
CONF.set_override(k, v)
|
CONF.set_override(k, v)
|
||||||
self._overrides.append(k)
|
|
||||||
|
|
||||||
def reset_opts(self):
|
|
||||||
for group, opt_list in self._group_overrides.iteritems():
|
|
||||||
for k in opt_list:
|
|
||||||
CONF.set_override(k, None, group)
|
|
||||||
for k in self._overrides:
|
|
||||||
CONF.set_override(k, None)
|
|
||||||
self._overrides = []
|
|
||||||
self._group_overrides = {}
|
|
||||||
CONF.reset()
|
|
||||||
|
|
||||||
def load_backends(self):
|
def load_backends(self):
|
||||||
"""Hacky shortcut to load the backends for data manipulation."""
|
"""Hacky shortcut to load the backends for data manipulation."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user