summaryrefslogtreecommitdiff
path: root/docker/api
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-31 16:39:39 -0800
committerJoffrey F <joffrey@docker.com>2018-01-31 16:52:26 -0800
commit7fabcdaa4cbcf1c7905c2c2e7669a5a4ac594735 (patch)
tree923fd6ac95208ce9dee9eadf63e879f7bef3f6d1 /docker/api
parent0a86ff0bcc33209cf1c3db38f71c30192851df3a (diff)
downloaddocker-py-wait_return.tar.gz
Update wait to always return a dictwait_return
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/api')
-rw-r--r--docker/api/container.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/docker/api/container.py b/docker/api/container.py
index 152a08b..962d8cb 100644
--- a/docker/api/container.py
+++ b/docker/api/container.py
@@ -1207,8 +1207,8 @@ class ContainerApiMixin(object):
or ``removed``
Returns:
- (int or dict): The exit code of the container. Returns the full API
- response if no ``StatusCode`` field is included.
+ (dict): The API's response as a Python dictionary, including
+ the container's exit code under the ``StatusCode`` attribute.
Raises:
:py:class:`requests.exceptions.ReadTimeout`
@@ -1226,8 +1226,4 @@ class ContainerApiMixin(object):
params['condition'] = condition
res = self._post(url, timeout=timeout, params=params)
- self._raise_for_status(res)
- json_ = res.json()
- if 'StatusCode' in json_:
- return json_['StatusCode']
- return json_
+ return self._result(res, True)