add debugFunction handler
This commit is contained in:
parent
9b3823a376
commit
2b5f5f3e7c
1 changed files with 12 additions and 0 deletions
|
|
@ -4829,6 +4829,18 @@ class RootExports(object):
|
|||
context.session.assertPerm('repo')
|
||||
repo_problem(repo_id)
|
||||
|
||||
def debugFunction(self, name, *args, **kwargs):
|
||||
# This is potentially dangerous, so it must be explicitly enabled
|
||||
allowed = context.opts.get('EnableFunctionDebug','no')
|
||||
if not allowed:
|
||||
raise koji.ActionNotAllowed, 'This call is not enabled'
|
||||
context.session.assertPerm('admin')
|
||||
func = globals().get(name)
|
||||
if callable(func):
|
||||
return func(*args, **kwargs)
|
||||
else:
|
||||
raise koji.GenericError, 'Unable to find function: %s' % name
|
||||
|
||||
tagChangedSinceEvent = staticmethod(tag_changed_since_event)
|
||||
createBuildTarget = staticmethod(create_build_target)
|
||||
editBuildTarget = staticmethod(edit_build_target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue