add check_frozen in master/slaves

This commit is contained in:
Emmanuel Garette 2017-05-05 21:40:44 +02:00
parent 6ca3e236f9
commit 1ee7d500dd
2 changed files with 12 additions and 8 deletions

View file

@ -117,30 +117,32 @@ class MasterSlaves(object):
def getitem(self, values, opt, path, validate, force_permissive,
trusted_cached_properties, validate_properties, session,
slave_path=undefined, slave_value=undefined,
setting_properties=undefined, self_properties=undefined, index=None):
setting_properties=undefined, self_properties=undefined, index=None,
check_frozen=False):
if self.is_master(opt):
return self._getmaster(values, opt, path, validate,
force_permissive,
validate_properties, slave_path,
slave_value, self_properties, index,
setting_properties, session)
setting_properties, session, check_frozen)
else:
return self._getslave(values, opt, path, validate,
force_permissive, trusted_cached_properties,
validate_properties, setting_properties,
self_properties, index,
session)
session, check_frozen)
def _getmaster(self, values, opt, path, validate, force_permissive,
validate_properties, c_slave_path,
c_slave_value, self_properties, index,
setting_properties, session):
setting_properties, session, check_frozen):
value = values._get_cached_value(opt, path=path, validate=validate,
force_permissive=force_permissive,
validate_properties=validate_properties,
self_properties=self_properties,
from_masterslave=True, index=index,
setting_properties=setting_properties)
setting_properties=setting_properties,
check_frozen=check_frozen)
if isinstance(value, Exception):
return value
if index is None and validate is True:
@ -153,7 +155,7 @@ class MasterSlaves(object):
def _getslave(self, values, opt, path, validate, force_permissive,
trusted_cached_properties, validate_properties, setting_properties,
self_properties, index, session):
self_properties, index, session, check_frozen):
"""
if master has length 0:
return []
@ -215,7 +217,8 @@ class MasterSlaves(object):
#self_properties=self_properties,
setting_properties=setting_properties,
masterlen=masterlen,
from_masterslave=True)
from_masterslave=True,
check_frozen=check_frozen)
if isinstance(value, Exception):
if isinstance(value, PropertiesOptionError):
err = value

View file

@ -282,7 +282,8 @@ class Values(object):
session,
setting_properties=setting_properties,
index=index,
self_properties=self_properties)
self_properties=self_properties,
check_frozen=check_frozen)
else:
val = self._get_validated_value(opt, path, validate,
force_permissive,