diff --git a/test/test_option_consistency.py b/test/test_option_consistency.py index a10db36..35d140d 100644 --- a/test/test_option_consistency.py +++ b/test/test_option_consistency.py @@ -753,3 +753,15 @@ def test_consistency_warnings_error(): with warnings.catch_warnings(record=True) as w: raises(ValueError, "cfg.a = 1") assert w == [] + + +def test_consistency_network_netmask_mandatory(): + a = NetworkOption('a', '', multi=True, properties=('mandatory',), default=[u'0.0.0.0']) + b = NetmaskOption('b', '', multi=True, properties=('mandatory',), default_multi=u'0.0.0.0') + od = OptionDescription('a', '', [a, b]) + od.impl_set_group_type(groups.master) + b.impl_add_consistency('network_netmask', a) + c = Config(od) + c.read_only() + c.cfgimpl_get_settings().remove('mandatory') + c.make_dict() diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 8dfae0f..26d5af2 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -485,7 +485,7 @@ class Settings(object): elif 'empty' in properties and \ 'empty' in setting_properties and \ self._getcontext().cfgimpl_get_values()._isempty( - opt_or_descr, value, force_allow_empty_list=True): + opt_or_descr, value, force_allow_empty_list=True, index=index): properties.add('mandatory') # should return 'frozen' only when tried to modify a value if check_frozen and 'everything_frozen' in setting_properties: