Revision e8ebbd2b lib/rapi/baserlib.py
b/lib/rapi/baserlib.py | ||
---|---|---|
195 | 195 |
raise http.HttpGatewayTimeout("Timeout while talking to the master" |
196 | 196 |
" daemon. Error: %s" % str(err)) |
197 | 197 |
|
198 |
|
|
199 |
def HandleItemQueryErrors(fn, *args, **kwargs): |
|
200 |
"""Converts errors when querying a single item. |
|
201 |
|
|
202 |
""" |
|
203 |
try: |
|
204 |
return fn(*args, **kwargs) |
|
205 |
except errors.OpPrereqError, err: |
|
206 |
if len(err.args) == 2 and err.args[1] == errors.ECODE_NOENT: |
|
207 |
raise http.HttpNotFound() |
|
208 |
|
|
209 |
raise |
|
210 |
|
|
211 |
|
|
198 | 212 |
def GetClient(): |
199 | 213 |
"""Geric wrapper for luxi.Client(), for better http compatiblity. |
200 | 214 |
|
Also available in: Unified diff