frozen with force_default_on_freeze can change owner
This commit is contained in:
parent
ed3373cff0
commit
a130cff4bf
4 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,7 @@ Sun Oct 26 08:50:38 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
|
||||||
* if option is frozen with force_default_on_freeze property, owner
|
* if option is frozen with force_default_on_freeze property, owner
|
||||||
must be 'default' check property when tried to change owner
|
must be 'default' check property when tried to change owner
|
||||||
* bad characters in DomainnameOption could be in warning level
|
* 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 <egarette@cadoles.com>
|
Sat Oct 25 22:48:08 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
|
||||||
* cannot add unvalaible consistency for an option
|
* cannot add unvalaible consistency for an option
|
||||||
|
|
|
@ -75,7 +75,7 @@ def test_force_default_on_freeze():
|
||||||
assert config.dummy2 is False
|
assert config.dummy2 is False
|
||||||
assert config.getowner(dummy1) == owners.default
|
assert config.getowner(dummy1) == owners.default
|
||||||
assert config.getowner(dummy2) == owners.user
|
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, "config.cfgimpl_get_values().setowner(dummy2, owners.frozen)")
|
||||||
raises(PropertiesOptionError, "del(config.dummy1)")
|
raises(PropertiesOptionError, "del(config.dummy1)")
|
||||||
setting[dummy1].remove('frozen')
|
setting[dummy1].remove('frozen')
|
||||||
|
@ -102,7 +102,7 @@ def test_force_default_on_freeze_multi():
|
||||||
assert config.dummy2 == [True, False]
|
assert config.dummy2 == [True, False]
|
||||||
assert config.getowner(dummy1) == owners.default
|
assert config.getowner(dummy1) == owners.default
|
||||||
assert config.getowner(dummy2) == owners.user
|
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, "config.cfgimpl_get_values().setowner(dummy2, owners.frozenmulti)")
|
||||||
raises(PropertiesOptionError, "del(config.dummy1)")
|
raises(PropertiesOptionError, "del(config.dummy1)")
|
||||||
setting[dummy1].remove('frozen')
|
setting[dummy1].remove('frozen')
|
||||||
|
|
|
@ -382,7 +382,7 @@ class Values(object):
|
||||||
self._setowner(opt, path, owner)
|
self._setowner(opt, path, owner)
|
||||||
|
|
||||||
def _setowner(self, 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}'
|
raise ConfigError(_('no value for {0} cannot change owner to {1}'
|
||||||
'').format(path, owner))
|
'').format(path, owner))
|
||||||
self._getcontext().cfgimpl_get_settings().validate_properties(opt,
|
self._getcontext().cfgimpl_get_settings().validate_properties(opt,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
Loading…
Reference in a new issue