mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 20:08:41 +00:00
Remove timeout when waiting for container to finish. (#527)
This commit is contained in:
parent
b318c02148
commit
3a40112a76
2
changelogs/fragments/527-container-wait.yml
Normal file
2
changelogs/fragments/527-container-wait.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "docker_container - when ``detach=false``, wait indefinitely and not at most one minute. This was the behavior with Docker SDK for Python, and was accidentally changed in 3.0.0 (https://github.com/ansible-collections/community.docker/issues/526, https://github.com/ansible-collections/community.docker/pull/527)."
|
||||||
@ -281,7 +281,7 @@ class EngineDriver(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def wait_for_container(self, client, container_id):
|
def wait_for_container(self, client, container_id, timeout=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
|
|||||||
@ -269,8 +269,8 @@ class DockerAPIEngineDriver(EngineDriver):
|
|||||||
def start_container(self, client, container_id):
|
def start_container(self, client, container_id):
|
||||||
client.post_json('/containers/{0}/start', container_id)
|
client.post_json('/containers/{0}/start', container_id)
|
||||||
|
|
||||||
def wait_for_container(self, client, container_id):
|
def wait_for_container(self, client, container_id, timeout=None):
|
||||||
return client.post_json_to_json('/containers/{0}/wait', container_id)['StatusCode']
|
return client.post_json_to_json('/containers/{0}/wait', container_id, timeout=timeout)['StatusCode']
|
||||||
|
|
||||||
def get_container_output(self, client, container_id):
|
def get_container_output(self, client, container_id):
|
||||||
config = client.get_json('/containers/{0}/json', container_id)
|
config = client.get_json('/containers/{0}/json', container_id)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user