From 022c6f478d4ca5b87b979139fe35a46c36461c07 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 26 Apr 2018 17:35:45 -0300 Subject: [PATCH] Remover pacote de migracao antes de gerar --- sapl/legacy/migracao.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapl/legacy/migracao.py b/sapl/legacy/migracao.py index 92dd439e1..66668a62f 100644 --- a/sapl/legacy/migracao.py +++ b/sapl/legacy/migracao.py @@ -31,6 +31,7 @@ def gerar_pacote(): # backup do banco print('Gerando backup do banco... ', end='', flush=True) arq_backup = DIR_REPO.child('{}.backup'.format(NOME_BANCO_LEGADO)) + arq_backup.remove() backup_cmd = ''' pg_dump --host localhost --port 5432 --username postgres --no-password --format custom --blobs --verbose --file {} {}'''.format( @@ -41,5 +42,6 @@ def gerar_pacote(): # tar de media/sapl print('Criando tar de media... ', end='', flush=True) arq_tar = DIR_REPO.child('{}.media.tar'.format(NOME_BANCO_LEGADO)) + arq_tar.remove() subprocess.check_output(['tar', 'cfh', arq_tar, '-C', DIR_REPO, 'sapl']) print('SUCESSO')