properties option in consistencies are now allowed

This commit is contained in:
Emmanuel Garette 2014-02-06 19:19:48 +01:00
parent c52b2f84f4
commit 72f06bc29d
2 changed files with 14 additions and 2 deletions

View File

@ -283,3 +283,14 @@ def test_consistency_not_all():
c.a = ['192.168.1.0'] c.a = ['192.168.1.0']
c.b = ['255.255.255.0'] c.b = ['255.255.255.0']
c.c = ['192.168.1.255'] c.c = ['192.168.1.255']
def test_consistency_permissive():
a = IntOption('a', '', 1)
b = IntOption('b', '', 2, properties=('hidden',))
od = OptionDescription('od', '', [a, b])
a.impl_add_consistency('not_equal', b)
c = Config(od)
c.cfgimpl_get_settings().setpermissive(('hidden',))
c.read_write()
c.a = 1

View File

@ -367,7 +367,8 @@ class Option(BaseOption):
#if context, calculate value, otherwise get default value #if context, calculate value, otherwise get default value
if context is not None: if context is not None:
opt_value = context._getattr( opt_value = context._getattr(
descr.impl_get_path_by_opt(opt), validate=False) descr.impl_get_path_by_opt(opt), validate=False,
force_permissive=True)
else: else:
opt_value = opt.impl_getdefault() opt_value = opt.impl_getdefault()