Skip to content

Commit a9d4c7e

Browse files
authored
Merge pull request #1653 from osallou/master
Closes #1588, image.tag does not return anything
2 parents 8fc6540 + d638829 commit a9d4c7e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docker/models/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def tag(self, repository, tag=None, **kwargs):
9696
Returns:
9797
(bool): ``True`` if successful
9898
"""
99-
self.client.api.tag(self.id, repository, tag=tag, **kwargs)
99+
return self.client.api.tag(self.id, repository, tag=tag, **kwargs)
100100

101101

102102
class ImageCollection(Collection):

tests/integration/models_images_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def test_tag_and_remove(self):
7171
client = docker.from_env(version=TEST_API_VERSION)
7272
image = client.images.pull('alpine:latest')
7373

74-
image.tag(repo, tag)
74+
result = image.tag(repo, tag)
75+
assert result is True
7576
self.tmp_imgs.append(identifier)
7677
assert image.id in get_ids(client.images.list(repo))
7778
assert image.id in get_ids(client.images.list(identifier))

0 commit comments

Comments
 (0)