Browse Source

Registra traceback no log de migração

pull/1847/head
Marcio Mazza 7 years ago
parent
commit
f202774905
  1. 3
      sapl/legacy/migracao_dados.py
  2. 2
      sapl/legacy/scripts/migra_um_db.sh

3
sapl/legacy/migracao_dados.py

@ -1,4 +1,5 @@
import re
import traceback
from collections import defaultdict
from datetime import date
from functools import lru_cache, partial
@ -724,6 +725,8 @@ class DataMigrator:
dir_ocorrencias = DIR_RESULTADOS.child(date.today().isoformat())
dir_ocorrencias.mkdir(parents=True)
self._do_migrate(obj)
except Exception as e:
ocorrencias['traceback'] = str(traceback.format_exc())
finally:
# grava ocorrências
arq_ocorrencias = dir_ocorrencias.child(

2
sapl/legacy/scripts/migra_um_db.sh

@ -39,7 +39,7 @@ if [ $# -ge 2 ]; then
echo "--- MIGRACAO ---" | tee -a $LOG
echo >> $LOG
DATABASE_NAME=$1 ./manage.py migracao_25_31 --force --settings sapl.legacy_migration_settings 2>&1 | tee -a $LOG
DATABASE_NAME=$1 ./manage.py migracao_25_31 --force --dados --settings sapl.legacy_migration_settings 2>&1 | tee -a $LOG
echo >> $LOG
else
echo "USO:"

Loading…
Cancel
Save