From f202774905a6ea8ff6c166d8bf63e9fd0cc18c50 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 22 Mar 2018 15:14:07 -0300 Subject: [PATCH] =?UTF-8?q?Registra=20traceback=20no=20log=20de=20migra?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_dados.py | 3 +++ sapl/legacy/scripts/migra_um_db.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migracao_dados.py b/sapl/legacy/migracao_dados.py index 9b7aecf86..ef96cb20a 100644 --- a/sapl/legacy/migracao_dados.py +++ b/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( diff --git a/sapl/legacy/scripts/migra_um_db.sh b/sapl/legacy/scripts/migra_um_db.sh index 577a2c000..ed4db9662 100755 --- a/sapl/legacy/scripts/migra_um_db.sh +++ b/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:"