diff --git a/docker/models/images.py b/docker/models/images.py index a9ed65ee35..e8af101d79 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -96,7 +96,7 @@ def tag(self, repository, tag=None, **kwargs): Returns: (bool): ``True`` if successful """ - self.client.api.tag(self.id, repository, tag=tag, **kwargs) + return self.client.api.tag(self.id, repository, tag=tag, **kwargs) class ImageCollection(Collection): diff --git a/tests/integration/models_images_test.py b/tests/integration/models_images_test.py index 6d61e4977c..881df0a1e5 100644 --- a/tests/integration/models_images_test.py +++ b/tests/integration/models_images_test.py @@ -71,7 +71,8 @@ def test_tag_and_remove(self): client = docker.from_env(version=TEST_API_VERSION) image = client.images.pull('alpine:latest') - image.tag(repo, tag) + result = image.tag(repo, tag) + assert result is True self.tmp_imgs.append(identifier) assert image.id in get_ids(client.images.list(repo)) assert image.id in get_ids(client.images.list(identifier))