add force_permissive in mandatory_warnings

This commit is contained in:
2014-10-26 16:39:24 +01:00
parent f730050f7c
commit c75867720f
4 changed files with 22 additions and 7 deletions

View File

@ -734,8 +734,3 @@ class MetaConfig(GroupConfig):
child._impl_meta = weakref.ref(self)
super(MetaConfig, self).__init__(children, session_id, persistent, descr)
def mandatory_warnings(config): # pragma: optional cover
#only for retro-compatibility
return config.cfgimpl_get_values().mandatory_warnings()

View File

@ -441,7 +441,7 @@ class Values(object):
raise ValueError(_("information's item"
" not found: {0}").format(key))
def mandatory_warnings(self):
def mandatory_warnings(self, force_permissive=False):
"""convenience function to trace Options that are mandatory and
where no value has been set
@ -462,7 +462,8 @@ class Values(object):
path = opt.impl_getpath(self._getcontext())
try:
self._get_cached_item(opt, path=path,
force_properties=frozenset(('mandatory',)))
force_properties=frozenset(('mandatory',)),
force_permissive=force_permissive)
except PropertiesOptionError as err:
if err.proptype == ['mandatory']:
_ret.append(path)