From 9a733a73207d1694f68b13d8b0460b5155167c93 Mon Sep 17 00:00:00 2001 From: jakedt Date: Wed, 5 Mar 2014 17:44:22 -0500 Subject: [PATCH] Sometimes status messages have an extra level of wrapping for some reason. --- workers/dockerfilebuild.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/workers/dockerfilebuild.py b/workers/dockerfilebuild.py index 39b2e559c..1cf1c2170 100644 --- a/workers/dockerfilebuild.py +++ b/workers/dockerfilebuild.py @@ -115,20 +115,21 @@ class DockerfileBuildContext(object): current_step = 0 built_image = None for status in unwrap_stream(build_status): - status_str = str(status.encode('utf-8')) + fully_unwrapped = status['message'] if 'message' in status else status + status_str = str(fully_unwrapped.encode('utf-8')) logger.debug('Status: %s', status_str) - step_increment = re.search(r'Step ([0-9]+) :', status) + step_increment = re.search(r'Step ([0-9]+) :', status_str) if step_increment: self._build_logger(status_str, build_logs.COMMAND) current_step = int(step_increment.group(1)) logger.debug('Step now: %s/%s' % (current_step, self._num_steps)) - with self._status as status: - status['current_command'] = current_step + with self._status as status_update: + status_update['current_command'] = current_step continue else: self._build_logger(status_str) - complete = re.match(r'Successfully built ([a-z0-9]+)$', status) + complete = re.match(r'Successfully built ([a-z0-9]+)$', status_str) if complete: built_image = complete.group(1) logger.debug('Final image ID is: %s' % built_image)