mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #37608 from gtmanfred/2016.3
allow multiline returns from docker for mac
This commit is contained in:
commit
019e1a721b
1 changed files with 14 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue