host.evalPolicy call
This commit is contained in:
parent
4319ba0be8
commit
4ae00ba556
1 changed files with 9 additions and 0 deletions
|
|
@ -10206,6 +10206,15 @@ class HostExports(object):
|
|||
host.verify()
|
||||
check_policy(name, data, default=default, strict=True)
|
||||
|
||||
def evalPolicy(self, name, data):
|
||||
"""Evaluate named policy with given data and return the result"""
|
||||
host = Host()
|
||||
host.verify()
|
||||
ruleset = context.policy.get(name)
|
||||
if not ruleset:
|
||||
raise koji.GenericError, "no such policy: %s" % name
|
||||
return ruleset.apply(data)
|
||||
|
||||
def newBuildRoot(self, repo, arch, task_id=None):
|
||||
host = Host()
|
||||
host.verify()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue