Revision 9ba38706 lib/rapi/baserlib.py
b/lib/rapi/baserlib.py | ||
---|---|---|
30 | 30 |
import logging |
31 | 31 |
|
32 | 32 |
from ganeti import luxi |
33 |
import ganeti.rpc.errors as rpcerr |
|
33 | 34 |
from ganeti import rapi |
34 | 35 |
from ganeti import http |
35 | 36 |
from ganeti import errors |
... | ... | |
366 | 367 |
# Could be a function, pylint: disable=R0201 |
367 | 368 |
try: |
368 | 369 |
return self._client_cls(address=address) |
369 |
except luxi.NoMasterError, err:
|
|
370 |
except rpcerr.NoMasterError, err:
|
|
370 | 371 |
raise http.HttpBadGateway("Can't connect to master daemon: %s" % err) |
371 |
except luxi.PermissionError:
|
|
372 |
except rpcerr.PermissionError:
|
|
372 | 373 |
raise http.HttpInternalServerError("Internal error: no permission to" |
373 | 374 |
" connect to the master daemon") |
374 | 375 |
|
... | ... | |
391 | 392 |
raise http.HttpServiceUnavailable("Job queue is full, needs archiving") |
392 | 393 |
except errors.JobQueueDrainError: |
393 | 394 |
raise http.HttpServiceUnavailable("Job queue is drained, cannot submit") |
394 |
except luxi.NoMasterError, err:
|
|
395 |
except rpcerr.NoMasterError, err:
|
|
395 | 396 |
raise http.HttpBadGateway("Master seems to be unreachable: %s" % err) |
396 |
except luxi.PermissionError:
|
|
397 |
except rpcerr.PermissionError:
|
|
397 | 398 |
raise http.HttpInternalServerError("Internal error: no permission to" |
398 | 399 |
" connect to the master daemon") |
399 |
except luxi.TimeoutError, err:
|
|
400 |
except rpcerr.TimeoutError, err:
|
|
400 | 401 |
raise http.HttpGatewayTimeout("Timeout while talking to the master" |
401 | 402 |
" daemon: %s" % err) |
402 | 403 |
|
Also available in: Unified diff