Merge pull request #37608 from gtmanfred/2016.3

allow multiline returns from docker for mac
This commit is contained in:
Mike Place 2016-11-11 10:48:59 +13:00 committed by GitHub
commit 019e1a721b

View file

@ -559,6 +559,17 @@ def __virtual__():
return (False, 'Docker module could not get imported')
class DockerJSONDecoder(json.JSONDecoder):
def decode(self, s, _w=None):
objs = []
for line in s.splitlines():
if not line:
continue
obj, _ = self.raw_decode(line)
objs.append(obj)
return objs
def _get_docker_py_versioninfo():
'''
Returns the version_info tuple from docker-py
@ -3459,7 +3470,9 @@ def build(path=None,
.format(image)
)
stream_data = [json.loads(x) for x in response]
stream_data = []
for line in response:
stream_data.extend(json.loads(line, cls=DockerJSONDecoder))
errors = []
# Iterate through API response and collect information
for item in stream_data: