From 0b66aa1d60aa05518b69dbb0b96387b504ec79e7 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Thu, 7 Jan 2016 13:11:32 -0500
Subject: [PATCH] Remote inspect binding.
Signed-off-by: William Temple <wtemple@redhat.com>
---
docker/api/image.py | 9 +++++++--
tests/unit/api_image_test.py | 3 ++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/docker/api/image.py b/docker/api/image.py
index c1ebc69..5dc6bb8 100644
--- a/docker/api/image.py
+++ b/docker/api/image.py
@@ -242,7 +242,7 @@ class ImageApiMixin(object):
return self._result(self._post(api_url, params=params))
@utils.check_resource
- def inspect_image(self, image):
+ def inspect_image(self, image, remote=False):
"""
Get detailed information about an image. Similar to the ``docker
inspect`` command, but only for containers.
@@ -258,8 +258,13 @@ class ImageApiMixin(object):
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
+ params = {}
+ if remote:
+ params['remote'] = 1
return self._result(
- self._get(self._url("/images/{0}/json", image)), True
+ self._get(self._url("/images/{0}/json".format(image)),
+ params=params),
+ True
)
def load_image(self, data):
diff --git a/tests/unit/api_image_test.py b/tests/unit/api_image_test.py
index fbfb146..2f83681 100644
--- a/tests/unit/api_image_test.py
+++ b/tests/unit/api_image_test.py
@@ -195,7 +195,8 @@ class ImageTest(BaseAPIClientTest):
fake_request.assert_called_with(
'GET',
url_prefix + 'images/test_image/json',
- timeout=DEFAULT_TIMEOUT_SECONDS
+ timeout=DEFAULT_TIMEOUT_SECONDS,
+ params={}
)
def test_inspect_image_undefined_id(self):
--
2.11.0