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:
parent
336ab0d2b1
commit
1f4032f56f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user