diff --git a/ChangeLog b/ChangeLog index bb4c863..04dcd46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Sun Oct 26 08:50:38 2014 +0200 Emmanuel Garette * if option is frozen with force_default_on_freeze property, owner must be 'default' check property when tried to change owner * bad characters in DomainnameOption could be in warning level + * frozen with force_default_on_freeze can change owner Sat Oct 25 22:48:08 2014 +0200 Emmanuel Garette * cannot add unvalaible consistency for an option diff --git a/test/test_option_default.py b/test/test_option_default.py index f7b483f..6aaf631 100644 --- a/test/test_option_default.py +++ b/test/test_option_default.py @@ -75,7 +75,7 @@ def test_force_default_on_freeze(): assert config.dummy2 is False assert config.getowner(dummy1) == owners.default assert config.getowner(dummy2) == owners.user - raises(ConfigError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozen)") + raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozen)") raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy2, owners.frozen)") raises(PropertiesOptionError, "del(config.dummy1)") setting[dummy1].remove('frozen') @@ -102,7 +102,7 @@ def test_force_default_on_freeze_multi(): assert config.dummy2 == [True, False] assert config.getowner(dummy1) == owners.default assert config.getowner(dummy2) == owners.user - raises(ConfigError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozenmulti)") + raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozenmulti)") raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy2, owners.frozenmulti)") raises(PropertiesOptionError, "del(config.dummy1)") setting[dummy1].remove('frozen') diff --git a/tiramisu/value.py b/tiramisu/value.py index d0a8eaa..4575cbf 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -382,7 +382,7 @@ class Values(object): self._setowner(opt, path, owner) def _setowner(self, opt, path, owner): - if self._getowner(opt, path) == owners.default: # pragma: optional cover + if not self._p_.hasvalue(path): # pragma: optional cover raise ConfigError(_('no value for {0} cannot change owner to {1}' '').format(path, owner)) self._getcontext().cfgimpl_get_settings().validate_properties(opt, diff --git a/translations/tiramisu.pot b/translations/tiramisu.pot index eee861d..57e07f7 100644 --- a/translations/tiramisu.pot +++ b/translations/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-10-26 09:35+CET\n" +"POT-Creation-Date: 2014-10-26 09:42+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"