1
mirror of https://github.com/home-assistant/supervisor synced 2024-08-05 03:49:58 +02:00

Add the log stream from docker if build fails (#2207)

* Add the log stream from docker if build fails

* Check if dict
This commit is contained in:
Joakim Sørensen 2020-11-02 11:44:11 +01:00 committed by GitHub
parent 336ab0d2b1
commit 1f4032f56f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -421,6 +421,15 @@ class DockerAddon(DockerInterface):
except (docker.errors.DockerException, requests.RequestException) as err:
_LOGGER.error("Can't build %s:%s: %s", self.image, tag, err)
if hasattr(err, "build_log"):
log = "\n".join(
[
x["stream"]
for x in err.build_log # pylint: disable=no-member
if isinstance(x, dict) and "stream" in x
]
)
_LOGGER.error("Build log: \n%s", log)
raise DockerError() from err
_LOGGER.info("Build %s:%s done", self.image, tag)