Revision b183c4a8 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
28 | 28 |
|
29 | 29 |
""" |
30 | 30 |
|
31 |
import sys |
|
31 | 32 |
import logging |
32 | 33 |
import random |
33 | 34 |
import time |
34 | 35 |
import itertools |
36 |
import traceback |
|
35 | 37 |
|
36 | 38 |
from ganeti import opcodes |
37 | 39 |
from ganeti import constants |
... | ... | |
354 | 356 |
if self._cbs: |
355 | 357 |
self._cbs.NotifyStart() |
356 | 358 |
|
357 |
result = self._ExecLU(lu) |
|
359 |
try: |
|
360 |
result = self._ExecLU(lu) |
|
361 |
except AssertionError, err: |
|
362 |
# this is a bit ugly, as we don't know from which phase |
|
363 |
# (prereq, exec) this comes; but it's better than an exception |
|
364 |
# with no information |
|
365 |
(_, _, tb) = sys.exc_info() |
|
366 |
err_info = traceback.format_tb(tb) |
|
367 |
del tb |
|
368 |
logging.exception("Detected AssertionError") |
|
369 |
raise errors.OpExecError("Internal assertion error: please report" |
|
370 |
" this as a bug.\nError message: '%s';" |
|
371 |
" location:\n%s" % (str(err), err_info[-1])) |
|
358 | 372 |
|
359 | 373 |
elif adding_locks and acquiring_locks: |
360 | 374 |
# We could both acquire and add locks at the same level, but for now we |
Also available in: Unified diff