refactor
This commit is contained in:
@ -125,8 +125,8 @@ class CacheOptionDescription(BaseOption):
|
||||
'must be in same master/slaves for {1}').format(
|
||||
require_opt.impl_getname(), option.impl_getname()))
|
||||
else:
|
||||
raise ValueError(_('malformed requirements option {0} '
|
||||
'must not be a multi for {1}').format(
|
||||
raise ValueError(_('malformed requirements option "{0}" '
|
||||
'must not be a multi for "{1}"').format(
|
||||
require_opt.impl_getname(), option.impl_getname()))
|
||||
if init:
|
||||
if len(cache_option) != len(set(cache_option)):
|
||||
@ -137,7 +137,7 @@ class CacheOptionDescription(BaseOption):
|
||||
if _consistencies != {}:
|
||||
self._cache_consistencies = {}
|
||||
for opt, cons in _consistencies.items():
|
||||
if opt not in cache_option: # pragma: optional cover
|
||||
if opt() not in cache_option: # pragma: optional cover
|
||||
raise ConfigError(_('consistency with option {0} '
|
||||
'which is not in Config').format(
|
||||
opt.impl_getname()))
|
||||
@ -437,12 +437,12 @@ class OptionDescription(OptionDescriptionWalk):
|
||||
for child in valid_child:
|
||||
if child == old: # pragma: optional cover
|
||||
raise ConflictError(_('duplicate option name: '
|
||||
'{0}').format(child))
|
||||
'"{0}"').format(child))
|
||||
if dynopt_names:
|
||||
for dynopt in dynopt_names:
|
||||
if child != dynopt and child.startswith(dynopt):
|
||||
raise ConflictError(_('option must not start as '
|
||||
'dynoptiondescription'))
|
||||
raise ConflictError(_('the option\'s name "{}" start as '
|
||||
'the dynoptiondescription\'s name "{}"').format(child, dynopt))
|
||||
old = child
|
||||
_setattr = object.__setattr__
|
||||
_setattr(self, '_children', (tuple(child_names), tuple(children)))
|
||||
@ -623,7 +623,7 @@ class MasterSlaves(OptionDescription):
|
||||
name))
|
||||
slaves.append(child)
|
||||
child._add_dependency(self)
|
||||
for child in children:
|
||||
for idx, child in enumerate(children):
|
||||
if child._is_symlinkoption(): # pragma: optional cover
|
||||
raise ValueError(_("master group {0} shall not have "
|
||||
"a symlinkoption").format(self.impl_getname()))
|
||||
@ -635,6 +635,11 @@ class MasterSlaves(OptionDescription):
|
||||
"in group {1}"
|
||||
": this option is not a multi"
|
||||
"").format(child.impl_getname(), self.impl_getname()))
|
||||
# no empty property for save
|
||||
if idx != 0:
|
||||
properties = list(child._properties)
|
||||
properties.remove('empty')
|
||||
child._properties = tuple(properties)
|
||||
callback, callback_params = master.impl_get_callback()
|
||||
if callback is not None and callback_params != {}:
|
||||
for callbacks in callback_params.values():
|
||||
|
Reference in New Issue
Block a user