Skip to content

Commit

Permalink
image load: don't depend on deprecated JSONMessage.error field
Browse files Browse the repository at this point in the history
The error field  was deprecated in favor of the errorDetail struct in
[moby@3043c26], but the API continued to return both. This patch updates
docker-py to not depend on the deprecated field.

[moby@3043c26]: moby/moby@3043c26

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jan 14, 2025
1 parent 03e43be commit 5a8a424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/models/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ def load(self, data):
if match:
image_id = match.group(2)
images.append(image_id)
if 'error' in chunk:
raise ImageLoadError(chunk['error'])
if 'errorDetail' in chunk:
raise ImageLoadError(chunk['errorDetail']['message'])

return [self.get(i) for i in images]

Expand Down

0 comments on commit 5a8a424

Please sign in to comment.