can get uncalculated property

This commit is contained in:
Emmanuel Garette 2019-12-02 10:40:17 +01:00
parent b6c11c08db
commit 8345a4651d

View File

@ -424,7 +424,8 @@ class Settings(object):
def getproperties(self,
option_bag,
apply_requires=True):
apply_requires=True,
uncalculated=False):
"""
"""
option = option_bag.option
@ -433,8 +434,7 @@ class Settings(object):
option = option.impl_getopt()
path = option.impl_getpath()
index = option_bag.index
if apply_requires:
if apply_requires and not uncalculated:
cache = config_bag.context._impl_properties_cache
config_bag_props = config_bag.properties
is_cached, props, validated = cache.getcache(path,
@ -456,7 +456,7 @@ class Settings(object):
index,
option.impl_getproperties()))
for prop in p_props:
if isinstance(prop, str):
if uncalculated or isinstance(prop, str):
props.add(prop)
elif apply_requires:
new_prop = prop.execute(option_bag,
@ -471,7 +471,7 @@ class Settings(object):
raise LeadershipError(_('leader cannot have "{}" property').format(new_prop))
props.add(new_prop)
props -= self.getpermissives(option_bag)
if apply_requires and not config_bag.is_unrestraint:
if not uncalculated and apply_requires and not config_bag.is_unrestraint:
cache.setcache(path,
index,
props,