Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docker/models/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,24 @@ def load(self, data):
data (binary): Image data to be loaded.

Returns:
(generator): Progress output as JSON objects
(list of :py:class:`Image`): The images.

Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
return self.client.api.load_image(data)
resp = self.client.api.load_image(data)
images = []
for chunk in resp:
if 'stream' in chunk:
match = re.search(
r'(^Loaded image ID: |^Loaded image: )(.+)$',
chunk['stream']
)
if match:
image_id = match.group(2)
images.append(image_id)
return [self.get(i) for i in images]

def pull(self, name, tag=None, **kwargs):
"""
Expand Down