make missing policy behavior configurable

This commit is contained in:
Mike McLean 2008-10-31 17:07:31 -04:00
parent 7be648ec55
commit 828a49971a
2 changed files with 7 additions and 2 deletions

View file

@ -4024,9 +4024,12 @@ def check_policy(name, data, default='deny', strict=False):
"""
ruleset = context.policy.get(name)
if not ruleset:
result = default
if context.opts.get('MissingPolicyOk'):
# for backwards compatibility, this is the default
result = "allow"
else:
result = "deny"
reason = "missing policy"
#XXX - maybe this should be an error condition
else:
result = ruleset.apply(data)
if result is None:

View file

@ -379,6 +379,8 @@ def load_config(req):
['KojiTraceback', 'string', None],
['EnableFunctionDebug', 'boolean', False],
['MissingPolicyOK', 'boolean', True],
['LockOut', 'boolean', False],
['ServerOffline', 'string', False],
['OfflineMessage', 'string', None],