From 7080996670632febe0db37e54d5ca7c20fac3fad Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 21 Aug 2015 13:28:34 -0400 Subject: [PATCH] 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 --- awx/main/migrations/0070_v221_changes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/migrations/0070_v221_changes.py b/awx/main/migrations/0070_v221_changes.py index 698028648e..0bc36f27ac 100644 --- a/awx/main/migrations/0070_v221_changes.py +++ b/awx/main/migrations/0070_v221_changes.py @@ -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