mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Update vendored Docker SDK for Python code (#694)
* vendored Docker SDK for Python code: volume: added support for bind propagation https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation Cherry-picked from https://github.com/docker/docker-py/commit/bea63224e028226085c85caecace6480fe0aa6b0 Co-authored-by: Janne Jakob Fleischer <janne.fleischer@ils-forschung.de> Co-authored-by: Milas Bowman <milas.bowman@docker.com> * vendored Docker SDK for Python code: fix: eventlet compatibility Check if poll attribute exists on select module instead of win32 platform check The implementation done in #2865 is breaking usage of docker-py library within eventlet. As per the Python `select.poll` documentation (https://docs.python.org/3/library/select.html#select.poll) and eventlet select removal advice (eventlet/eventlet#608 (comment)), it is preferable to use an implementation based on the availability of the `poll()` method that trying to check if the platform is `win32`. Fixes https://github.com/docker/docker-py/issues/3131 Cherry-picked from https://github.com/docker/docker-py/commit/78439ebbe1aae77ff0fd9b666894d80807182e28 Co-authored-by: Mathieu Virbel <mat@meltingrocks.com> * vendored Docker SDK for Python code: fix: use response.text to get string rather than bytes Adjusted from https://github.com/docker/docker-py/commit/0618951093bf3116af482c6dfb983219c5684343 Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Co-authored-by: Milas Bowman <milas.bowman@docker.com> * vendored Docker SDK for Python code: Fix missing asserts or assignments Cherry-picked from https://github.com/docker/docker-py/commit/0566f1260cd6f89588df2128ec4e86e8266e5d74 Co-authored-by: Aarni Koskela <akx@iki.fi> --------- Co-authored-by: Janne Jakob Fleischer <janne.fleischer@ils-forschung.de> Co-authored-by: Milas Bowman <milas.bowman@docker.com> Co-authored-by: Mathieu Virbel <mat@meltingrocks.com> Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Co-authored-by: Aarni Koskela <akx@iki.fi>
This commit is contained in:
@@ -12,6 +12,7 @@ __metaclass__ = type
|
||||
|
||||
from ._import_helper import HTTPError as _HTTPError
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.six import raise_from
|
||||
|
||||
|
||||
@@ -32,7 +33,7 @@ def create_api_error_from_http_exception(e):
|
||||
try:
|
||||
explanation = response.json()['message']
|
||||
except ValueError:
|
||||
explanation = (response.content or '').strip()
|
||||
explanation = to_native((response.content or '').strip())
|
||||
cls = APIError
|
||||
if response.status_code == 404:
|
||||
if explanation and ('No such image' in str(explanation) or
|
||||
|
||||
Reference in New Issue
Block a user