suffix can have a none str value

This commit is contained in:
Emmanuel Garette 2022-10-01 19:33:04 +02:00
parent 7f78728ad1
commit 89c095e0d3
3 changed files with 6 additions and 12 deletions

View file

@ -279,9 +279,7 @@ async def manager_callback(callbk: Param,
except ValueError as err:
raise ValueError(_('the option "{0}" is used in a calculation but is invalid ({1})').format(option_bag.option.impl_get_display_name(), err))
except AttributeError as err:
raise ConfigError(_('impossible to calculate "{0}", {1}').format(option_bag.option.impl_get_display_name(),
err,
))
raise ConfigError(_(f'unable to get value for calculating "{option_bag.option.impl_get_display_name()}", {err}'))
return value
async def get_option_bag(config_bag,

View file

@ -106,7 +106,6 @@ class SubConfig:
desc,
resetted_opts,
option_bag):
if option_bag.path in resetted_opts:
return
resetted_opts.append(option_bag.path)
@ -185,16 +184,13 @@ class SubConfig:
context = self.cfgimpl_get_context()
desc = context.cfgimpl_get_description()
if option_bag is not None:
if 'cache' in option_bag.config_bag.properties:
has_cache = True
option_bag.config_bag.properties = option_bag.config_bag.properties - {'cache'}
else:
has_cache = False
if 'cache' not in option_bag.config_bag.properties:
return
option_bag.config_bag.properties = option_bag.config_bag.properties - {'cache'}
await self.reset_one_option_cache(desc,
resetted_opts,
option_bag)
if has_cache:
option_bag.config_bag.properties = option_bag.config_bag.properties | {'cache'}
option_bag.config_bag.properties = option_bag.config_bag.properties | {'cache'}
else:
context._impl_values_cache.reset_all_cache()
context._impl_properties_cache.reset_all_cache()

View file

@ -119,7 +119,7 @@ class SynDynOptionDescription:
return rootpath + self.impl_getname()
def impl_get_display_name(self) -> str:
return self.opt.impl_get_display_name() + self._suffix
return self.opt.impl_get_display_name() + str(self._suffix)
class SynDynLeadership(SynDynOptionDescription):