config_bag and name not already exists

This commit is contained in:
Emmanuel Garette 2020-08-15 00:23:48 +02:00
parent 50d42624cc
commit afeedc1db6
2 changed files with 5 additions and 5 deletions

View file

@ -87,8 +87,8 @@ class CommonTiramisu(TiramisuHelp):
async def _get_option(self,
connection) -> Any:
if not self._subconfig:
config_bag = self._option_bag.config_bag
if not self._subconfig:
try:
subconfig, name = await config_bag.context.cfgimpl_get_home_by_path(self._option_bag.path,
config_bag,
@ -101,7 +101,7 @@ class CommonTiramisu(TiramisuHelp):
self._name = name
option = self._option_bag.option
if option is None:
option = await self._subconfig.cfgimpl_get_description().get_child(name,
option = await self._subconfig.cfgimpl_get_description().get_child(self._name,
config_bag,
self._subconfig.cfgimpl_get_path())
self._option_bag.option = option

View file

@ -64,11 +64,11 @@ class SubConfig:
(not isinstance(descr, (BaseOption, SynDynOptionDescription)) or
not descr.impl_is_optiondescription()):
try:
msg = descr.impl_get_displayname()
msg = descr.impl_get_display_name()
except AttributeError:
msg = descr
raise TypeError(_('"{0}" must be an optiondescription, not an {1}'
).format(msg, type(descr)))
raise TypeError(_('cannot create a sub config for "{0}" this is a "{1}", not an "OptionDescription"'
).format(msg, descr.__class__.__name__))
self._impl_descr = descr
self._impl_context = context
self._impl_path = subpath