mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Fix running docker container with not readable logging driver. Fixes #27278
This commit is contained in:
parent
44d2f21e02
commit
fb4d065654
1 changed files with 8 additions and 1 deletions
|
@ -1957,7 +1957,14 @@ class ContainerManager(DockerBaseClass):
|
||||||
|
|
||||||
if not self.parameters.detach:
|
if not self.parameters.detach:
|
||||||
status = self.client.wait(container_id)
|
status = self.client.wait(container_id)
|
||||||
|
config = self.client.inspect_container(container_id)
|
||||||
|
logging_driver = config['HostConfig']['LogConfig']['Type']
|
||||||
|
|
||||||
|
if logging_driver == 'json-file' or logging_driver == 'journald':
|
||||||
output = self.client.logs(container_id, stdout=True, stderr=True, stream=False, timestamps=False)
|
output = self.client.logs(container_id, stdout=True, stderr=True, stream=False, timestamps=False)
|
||||||
|
else:
|
||||||
|
output = "Result logged using `%s` driver" % logging_driver
|
||||||
|
|
||||||
if status != 0:
|
if status != 0:
|
||||||
self.fail(output, status=status)
|
self.fail(output, status=status)
|
||||||
if self.parameters.cleanup:
|
if self.parameters.cleanup:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue