fix: name is mandatory for config inside a metaconfig
This commit is contained in:
parent
cc79c28d40
commit
71fbe6dcbd
2 changed files with 6 additions and 2 deletions
|
|
@ -533,7 +533,7 @@ def test_multi_submulti_meta():
|
|||
od1 = OptionDescription('od', '', [multi])
|
||||
cfg = Config(od1, name='cfg')
|
||||
cfg.property.read_write()
|
||||
cfg2 = Config(od1)
|
||||
cfg2 = Config(od1, name="cfg2")
|
||||
cfg2.property.read_write()
|
||||
meta = MetaConfig([cfg, cfg2])
|
||||
meta.property.read_write()
|
||||
|
|
@ -554,7 +554,7 @@ def test_multi_submulti_meta_no_cache():
|
|||
od1 = OptionDescription('od', '', [multi])
|
||||
cfg = Config(od1, name='cfg')
|
||||
cfg.property.read_write()
|
||||
cfg2 = Config(od1)
|
||||
cfg2 = Config(od1, name="cfg2")
|
||||
cfg.property.read_write()
|
||||
meta = MetaConfig([cfg, cfg2])
|
||||
meta.property.read_write()
|
||||
|
|
|
|||
|
|
@ -1894,6 +1894,10 @@ class KernelMetaConfig(KernelMixConfig):
|
|||
raise TypeError(_("child must be a Config or MetaConfig"))
|
||||
if descr is None:
|
||||
descr = child.get_description()
|
||||
if child.impl_getname() is None:
|
||||
raise ConfigError(
|
||||
_("children in MetaConfig must have name")
|
||||
)
|
||||
elif descr is not child.get_description():
|
||||
raise ValueError(
|
||||
_(
|
||||
|
|
|
|||
Loading…
Reference in a new issue