Cleanup stdout dump during 2.2 migration

postgres is adding extra newline/carriage return escapes to the stdout
output.  Here we'll use sed to fix those so they can be read correctly
This commit is contained in:
Matthew Jones 2015-08-21 13:28:34 -04:00
parent 4ce2300d27
commit 7080996670

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import uuid
import os
import subprocess
from south.utils import datetime_utils as datetime
from south.db import db
@ -20,6 +21,8 @@ class Migration(DataMigration):
j.result_stdout_file = stdout_filename
j.result_stdout_text = ""
j.save()
sed_command = subprocess.Popen(["sed", "-i", "-e", "s/\\\\r\\\\n/\\n/g", stdout_filename])
sed_command.wait()
def backwards(self, orm):
pass