valid correctly consistencies for master/slaves

This commit is contained in:
2016-03-18 19:55:41 +01:00
parent 5a5231c2d8
commit 924692d3ab
2 changed files with 56 additions and 8 deletions

View File

@ -387,6 +387,7 @@ class Option(OnlyOption):
descr = context.cfgimpl_get_description()
all_cons_vals = []
val_consistencies = True
for opt in all_cons_opts:
#get value
if (isinstance(opt, DynSymLinkOption) and option._dyn == opt._dyn) or \
@ -406,11 +407,11 @@ class Option(OnlyOption):
if isinstance(opt_value, PropertiesOptionError):
log.debug('propertyerror in _launch_consistency: {0}'.format(opt_value))
if transitive:
raise opt_value
return opt_value
else:
return
else:
raise opt_value
return opt_value
else:
opt_value = opt.impl_getdefault()
@ -419,12 +420,14 @@ class Option(OnlyOption):
and option._dyn == opt._dyn) or \
option == opt:
all_cons_vals.append(opt_value)
#consistency with submulti is now forbidden
#elif self.impl_is_submulti():
# all_cons_vals.append(opt_value[index][submulti_index])
else:
all_cons_vals.append(opt_value[index])
return getattr(self, func)(all_cons_opts, all_cons_vals, warnings_only)
if index is not None:
all_cons_vals.append(opt_value[index])
else:
#only check properties for slaves
val_consistencies = False
if val_consistencies:
return getattr(self, func)(all_cons_opts, all_cons_vals, warnings_only)
def impl_validate(self, value, context=undefined, validate=True,
force_index=None, force_submulti_index=None,
@ -502,6 +505,8 @@ class Option(OnlyOption):
warning = ret
elif isinstance(ret, ValueError):
error = ret
else:
return ret
if warning:
msg = _("warning on the value of the option {0}: {1}").format(
self.impl_getname(), warning)
@ -554,6 +559,9 @@ class Option(OnlyOption):
err = do_validation(val, idx, force_submulti_index)
if err:
return err
else:
return self._valid_consistency(current_opt, None, context,
None, None)
def impl_is_master_slaves(self, type_='both'):
"""FIXME