make missing policy behavior configurable
This commit is contained in:
parent
7be648ec55
commit
828a49971a
2 changed files with 7 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue