retry whitelist
This commit is contained in:
parent
ccfcad52ab
commit
ab1559c5bb
1 changed files with 18 additions and 3 deletions
21
koji/auth.py
21
koji/auth.py
|
|
@ -36,6 +36,19 @@ from mod_python import apache
|
|||
# - maybe in two steps
|
||||
# -
|
||||
|
||||
|
||||
RetryWhitelist = [
|
||||
'host.taskWait',
|
||||
'host.taskUnwait',
|
||||
'host.taskSetWait',
|
||||
'host.updateHost',
|
||||
'host.setBuildRootState',
|
||||
'repoExpire',
|
||||
'repoDelete',
|
||||
'repoProblem',
|
||||
]
|
||||
|
||||
|
||||
class Session(object):
|
||||
|
||||
def __init__(self,args=None,hostip=None):
|
||||
|
|
@ -121,9 +134,11 @@ class Session(object):
|
|||
#We only schedule a commit for dml operations, so if we find the
|
||||
#callnum in the db then a previous attempt succeeded but failed to
|
||||
#return. Data was changed, so we cannot simply try the call again.
|
||||
raise koji.RetryError, \
|
||||
"unable to retry call %d (method %s) for session %d" \
|
||||
% (callnum, getattr(context, 'method', 'UNKNOWN'), id)
|
||||
method = getattr(context, 'method', 'UNKNOWN')
|
||||
if method not in RetryWhitelist:
|
||||
raise koji.RetryError, \
|
||||
"unable to retry call %d (method %s) for session %d" \
|
||||
% (callnum, method, id)
|
||||
|
||||
# read user data
|
||||
#historical note:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue