# HG changeset patch # User Laurent Peuch # Date 1558564411 -7200 # Node ID 3cf37ec616ad341b1bdf5b84cdafdb3a6608def5 # Parent 30b205676182b2d1fdedd60c1098ad2fe2711bf7 [migrations/pdb] add to every failing migration operation a "p(db)" option Instead, the migration command will just crash without offering the possibility of the user to debug or continue the migration. Closes #17219772 diff -r 30b205676182 -r 3cf37ec616ad cubicweb/migration.py --- a/cubicweb/migration.py Wed May 29 20:29:07 2019 +0200 +++ b/cubicweb/migration.py Thu May 23 00:33:31 2019 +0200 @@ -23,6 +23,7 @@ import logging import tempfile import itertools +import traceback from os.path import exists, join, basename, splitext from itertools import chain @@ -133,8 +134,14 @@ # search self.__class__ to avoid infinite recursion if hasattr(self.__class__, cmd): meth = getattr(self, cmd) - return lambda *args, **kwargs: self.interact(args, kwargs, - meth=meth) + try: + return lambda *args, **kwargs: self.interact(args, kwargs, + meth=meth) + except: + _, ex, traceback_ = sys.exc_info() + traceback.print_exc() + if self.confirm('abort?', pdb=True, traceback=traceback_): + raise raise raise AttributeError(name)