Fix split buffer with inconsistently delimited json objects.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-10-05 12:56:10 -04:00
commit 15d0c60a73
6 changed files with 62 additions and 22 deletions

View file

@ -1,5 +1,3 @@
import json
from compose import utils
@ -14,8 +12,7 @@ def stream_output(output, stream):
lines = {}
diff = 0
for chunk in utils.stream_as_text(output):
event = json.loads(chunk)
for event in utils.json_stream(output):
all_events.append(event)
if 'progress' in event or 'progressDetail' in event: