consistency "not_equal" works now with multi
This commit is contained in:
@ -24,7 +24,7 @@ import re
|
||||
|
||||
from ..i18n import _
|
||||
from ..setting import groups, undefined, owners # , log
|
||||
from .baseoption import BaseOption, SymLinkOption, Option
|
||||
from .baseoption import BaseOption, SymLinkOption, Option, allowed_const_list
|
||||
from . import MasterSlaves
|
||||
from ..error import ConfigError, ConflictError
|
||||
from ..storage import get_storages_option
|
||||
@ -131,22 +131,22 @@ class OptionDescription(BaseOption, StorageOptionDescription):
|
||||
force_store_values.append((subpath, option))
|
||||
for func, all_cons_opts, params in option._get_consistencies():
|
||||
option._valid_consistencies(all_cons_opts[1:], init=False)
|
||||
if is_multi:
|
||||
if func not in allowed_const_list and is_multi:
|
||||
is_slave = option.impl_is_master_slaves()
|
||||
if not is_slave:
|
||||
raise ValueError(_('malformed consistency option {0} '
|
||||
raise ValueError(_('malformed consistency option "{0}" '
|
||||
'must be a master/slaves').format(
|
||||
option.impl_getname()))
|
||||
masterslaves = option.impl_get_master_slaves()
|
||||
for opt in all_cons_opts:
|
||||
if is_multi:
|
||||
if func not in allowed_const_list and is_multi:
|
||||
if not opt.impl_is_master_slaves():
|
||||
raise ValueError(_('malformed consistency option {0} '
|
||||
'must not be a multi for {1}').format(
|
||||
raise ValueError(_('malformed consistency option "{0}" '
|
||||
'must not be a multi for "{1}"').format(
|
||||
option.impl_getname(), opt.impl_getname()))
|
||||
elif masterslaves != opt.impl_get_master_slaves():
|
||||
raise ValueError(_('malformed consistency option {0} '
|
||||
'must be in same master/slaves for {1}').format(
|
||||
raise ValueError(_('malformed consistency option "{0}" '
|
||||
'must be in same master/slaves for "{1}"').format(
|
||||
option.impl_getname(), opt.impl_getname()))
|
||||
_consistencies.setdefault(opt,
|
||||
[]).append((func,
|
||||
|
Reference in New Issue
Block a user