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,
opt,
subconfig):
if self._config_bag.properties:
option_bag = OptionBag()
option_bag.set_option(opt,
opt.impl_getpath(),
None,
self._config_bag)
if opt.impl_is_optiondescription():
self._config_bag.context.cfgimpl_get_settings().validate_properties(option_bag)
return subconfig.get_subconfig(option_bag)
subconfig.getattr(opt.impl_getname(),
option_bag)
option_bag = OptionBag()
option_bag.set_option(opt,
opt.impl_getpath(),
None,
self._config_bag)
if opt.impl_is_optiondescription():
self._config_bag.context.cfgimpl_get_settings().validate_properties(option_bag)
return subconfig.get_subconfig(option_bag)
subconfig.getattr(opt.impl_getname(),
option_bag)
def _walk(self,
option,

View File

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