From 270a62b8c1a81343fcb5a4077cedea2865ea98ae Mon Sep 17 00:00:00 2001 From: jakedt Date: Wed, 5 Mar 2014 10:32:24 -0500 Subject: [PATCH] Fix the build worker to use the latest docker-py. --- workers/dockerfilebuild.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/workers/dockerfilebuild.py b/workers/dockerfilebuild.py index d0ee58360..39b2e559c 100644 --- a/workers/dockerfilebuild.py +++ b/workers/dockerfilebuild.py @@ -49,6 +49,11 @@ class StatusWrapper(object): build_logs.set_status(self._uuid, self._status) +def unwrap_stream(json_stream): + for json_entry in json_stream: + yield json.loads(json_entry).values()[0] + + class DockerfileBuildContext(object): def __init__(self, build_context_dir, dockerfile_subdir, repo, tag_names, push_token, build_uuid): @@ -57,7 +62,7 @@ class DockerfileBuildContext(object): self._repo = repo self._tag_names = tag_names self._push_token = push_token - self._cl = Client(timeout=1200, version='1.7') + self._cl = Client(timeout=1200) self._status = StatusWrapper(build_uuid) self._build_logger = partial(build_logs.append_log_message, build_uuid) @@ -109,7 +114,7 @@ class DockerfileBuildContext(object): current_step = 0 built_image = None - for status in build_status: + for status in unwrap_stream(build_status): status_str = str(status.encode('utf-8')) logger.debug('Status: %s', status_str) step_increment = re.search(r'Step ([0-9]+) :', status)