diff options
| author | drebs <drebs@leap.se> | 2016-08-19 11:50:33 -0300 | 
|---|---|---|
| committer | drebs <drebs@leap.se> | 2016-08-23 18:48:26 -0300 | 
| commit | 46bb2b65e6fe642b07dee1de6c628c6f2cd303fd (patch) | |
| tree | 910d514396780df969592ecc72b9b8eaf27a3650 /scripts/migration/0.8.2/migrate.py | |
| parent | bebbaad4988c4f4ec26d37791f7738ea27719fca (diff) | |
[pkg] add --pdb option to migration script
Diffstat (limited to 'scripts/migration/0.8.2/migrate.py')
| -rwxr-xr-x | scripts/migration/0.8.2/migrate.py | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/migration/0.8.2/migrate.py b/scripts/migration/0.8.2/migrate.py index adc0f7d9..fe612221 100755 --- a/scripts/migration/0.8.2/migrate.py +++ b/scripts/migration/0.8.2/migrate.py @@ -85,10 +85,22 @@ def _parse_args():      parser.add_argument(          '--log-file',          help='the log file to use') +    parser.add_argument( +        '--pdb', action='store_true', +        help='escape to pdb shell in case of exception')      return parser.parse_args() +def _enable_pdb(): +    import sys +    from IPython.core import ultratb +    sys.excepthook = ultratb.FormattedTB( +        mode='Verbose', color_scheme='Linux', call_pdb=1) + +  if __name__ == '__main__':      args = _parse_args() +    if args.pdb: +        _enable_pdb()      _configure_logger(args.log_file)      migrate(args, TARGET_VERSION)  | 
