From cb89c74201cfc3775ee898a8e1b1b7c1d7ee4566 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 16 Mar 2016 22:33:28 +0100 Subject: [PATCH] don't check 'mandatory' setting for symlink --- test/test_mandatory.py | 10 +++++----- tiramisu/value.py | 10 +++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/test/test_mandatory.py b/test/test_mandatory.py index 5510107..4590d42 100644 --- a/test/test_mandatory.py +++ b/test/test_mandatory.py @@ -485,10 +485,10 @@ def test_mandatory_warnings_symlink(): setting = config.cfgimpl_get_settings() config.read_write() config.str - assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3'] + assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3'] setting[descr.str].append('frozen') config.read_only() - assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3'] + assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3'] def test_mandatory_warnings_validate(): @@ -496,10 +496,10 @@ def test_mandatory_warnings_validate(): config = Config(descr) config.str = '' raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())") - assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'unicode2', 'str3', 'unicode1', 'int1'] + assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'str3', 'unicode1', 'int1'] config.str = 'test' raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())") - assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str1', 'unicode2', 'str3'] + assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str1', 'str3'] def test_mandatory_warnings_validate_empty(): @@ -508,7 +508,7 @@ def test_mandatory_warnings_validate_empty(): config.str = '' config.read_only() raises(ConfigError, "list(config.cfgimpl_get_values().mandatory_warnings())") - assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'unicode2', 'str3', 'unicode1'] + assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'str3', 'unicode1'] def test_mandatory_warnings_requires(): diff --git a/tiramisu/value.py b/tiramisu/value.py index 72f1b58..37d01c2 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -610,16 +610,12 @@ class Values(object): else: if isinstance(opt, SymLinkOption) and \ not isinstance(opt, DynSymLinkOption): - true_opt = opt._impl_getopt() - true_path = descr.impl_get_path_by_opt(true_opt) - else: - true_opt = opt - true_path = path - self_properties = settings._getproperties(true_opt, true_path, + continue + self_properties = settings._getproperties(opt, path, read_write=False, setting_properties=setting_properties) if 'mandatory' in self_properties: - err = self._get_cached_value(true_opt, path=true_path, + err = self._get_cached_value(opt, path=path, trusted_cached_properties=False, force_permissive=force_permissive, setting_properties=setting_properties,