supply make_dict with slave

This commit is contained in:
Emmanuel Garette 2018-11-17 22:37:08 +01:00
parent f86cbb1bcd
commit 17bd7c3c05
2 changed files with 20 additions and 38 deletions

View File

@ -1004,17 +1004,16 @@ class TiramisuContextOption(TiramisuContext):
def _filter(self, def _filter(self,
opt, opt,
subconfig): subconfig):
if self._config_bag.properties: option_bag = OptionBag()
option_bag = OptionBag() option_bag.set_option(opt,
option_bag.set_option(opt, opt.impl_getpath(),
opt.impl_getpath(), None,
None, self._config_bag)
self._config_bag) if opt.impl_is_optiondescription():
if opt.impl_is_optiondescription(): self._config_bag.context.cfgimpl_get_settings().validate_properties(option_bag)
self._config_bag.context.cfgimpl_get_settings().validate_properties(option_bag) return subconfig.get_subconfig(option_bag)
return subconfig.get_subconfig(option_bag) subconfig.getattr(opt.impl_getname(),
subconfig.getattr(opt.impl_getname(), option_bag)
option_bag)
def _walk(self, def _walk(self,
option, option,

View File

@ -331,8 +331,11 @@ class SubConfig(object):
idx, idx,
config_bag) config_bag)
soption_bag.fromconsistency = option_bag.fromconsistency.copy() soption_bag.fromconsistency = option_bag.fromconsistency.copy()
value.append(self.getattr(name, try:
soption_bag)) value.append(self.getattr(name,
soption_bag))
except PropertiesOptionError as err:
value.append(err)
else: else:
value = self.cfgimpl_get_values().get_cached_value(option_bag) value = self.cfgimpl_get_values().get_cached_value(option_bag)
self.cfgimpl_get_settings().validate_mandatory(value, self.cfgimpl_get_settings().validate_mandatory(value,
@ -575,31 +578,11 @@ class SubConfig(object):
except PropertiesOptionError: except PropertiesOptionError:
pass pass
else: else:
if option.impl_is_master_slaves('slave'): try:
ret = [] ret = self.getattr(name,
try: option_bag)
self.cfgimpl_get_settings().validate_properties(option_bag) except PropertiesOptionError:
length = self.cfgimpl_get_length_slave(option_bag) return
except PropertiesOptionError:
return
if length:
for idx in range(length):
soption_bag = OptionBag()
soption_bag.set_option(option,
option_bag.path,
idx,
option_bag.config_bag)
try:
ret.append(self.getattr(name,
soption_bag))
except PropertiesOptionError as err:
ret.append(err)
else:
try:
ret = self.getattr(name,
option_bag)
except PropertiesOptionError:
return
if flatten: if flatten:
name_ = option.impl_getname() name_ = option.impl_getname()
elif fullpath: elif fullpath: