if impl_is_readonly is not False => duplicated option !
This commit is contained in:
parent
c86cad227e
commit
f86cbb1bcd
|
@ -483,6 +483,8 @@ class SubConfig(object):
|
|||
fullpath,
|
||||
pathsvalues):
|
||||
if withoption is not None:
|
||||
# Find all option with criteria
|
||||
# retrieve OptionDescription and make_dict on it
|
||||
mypath = self.cfgimpl_get_path()
|
||||
for path in context.find(bytype=None,
|
||||
byname=withoption,
|
||||
|
|
|
@ -71,7 +71,7 @@ class MasterSlaves(OptionDescription):
|
|||
'').format(self.impl_get_display_name(),
|
||||
child.impl_get_display_name()))
|
||||
if idx != 0 and child.impl_getdefault() != []:
|
||||
raise ValueError(_('not allowed default value for option "{0}" '
|
||||
raise ValueError(_('not allowed default value for slave option "{0}" '
|
||||
'in masterslaves "{1}"'
|
||||
'').format(child.impl_get_display_name(),
|
||||
self.impl_get_display_name()))
|
||||
|
|
|
@ -150,14 +150,11 @@ class CacheOptionDescription(BaseOption):
|
|||
raise ValueError(_('malformed requirements option "{0}" '
|
||||
'must not be a multi for "{1}"').format(
|
||||
require_opt.impl_getname(), option.impl_getname()))
|
||||
if option.impl_is_readonly():
|
||||
raise ConflictError(_('duplicate option: {0}').format(option))
|
||||
option._path = subpath
|
||||
option._set_readonly()
|
||||
if init:
|
||||
if __debug__ and len(cache_option) != len(set(cache_option)):
|
||||
for idx in range(1, len(cache_option) + 1):
|
||||
opt = cache_option.pop(0)
|
||||
if opt in cache_option:
|
||||
raise ConflictError(_('duplicate option: {0}').format(opt))
|
||||
if _consistencies != {}:
|
||||
self._cache_consistencies = {}
|
||||
for weak_opt, cons in _consistencies.items():
|
||||
|
@ -168,7 +165,7 @@ class CacheOptionDescription(BaseOption):
|
|||
opt.impl_getname()))
|
||||
self._cache_consistencies[opt] = tuple(cons)
|
||||
self._cache_force_store_values = force_store_values
|
||||
self._path = subpath
|
||||
self._path = self._name
|
||||
self._set_readonly()
|
||||
|
||||
def impl_build_force_store_values(self,
|
||||
|
|
Loading…
Reference in New Issue