git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
865d6fa
)
- raise an xmlrpclib.Fault on any exception while parsing/delivering ticket
author
Mark Huang
<mlhuang@cs.princeton.edu>
Thu, 1 Feb 2007 21:55:19 +0000
(21:55 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Thu, 1 Feb 2007 21:55:19 +0000
(21:55 +0000)
api.py
patch
|
blob
|
history
diff --git
a/api.py
b/api.py
index
6484f48
..
825539f
100644
(file)
--- a/
api.py
+++ b/
api.py
@@
-49,13
+49,12
@@
def Help():
@export_to_api(1)
def Ticket(tkt):
"""Ticket(tkt): deliver a ticket"""
@export_to_api(1)
def Ticket(tkt):
"""Ticket(tkt): deliver a ticket"""
- succeeded = False
- if type(tkt) == str:
+ try:
data = ticket.verify(tkt)
if data != None:
deliver_ticket(data)
data = ticket.verify(tkt)
if data != None:
deliver_ticket(data)
- succeeded = True
-
if not succeeded: raise xmlrpclib.Fault(102, 'Invalid argument: the sole argument must be a valid ticket as returned from GetTicket().'
)
+ except Exception, err:
+
raise xmlrpclib.Fault(102, 'Ticket error: ' + str(err)
)
@export_to_api(1)
def Create(rec):
@export_to_api(1)
def Create(rec):