mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +00: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:
|
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||||
_LOGGER.error("Can't build %s:%s: %s", self.image, tag, 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
|
raise DockerError() from err
|
||||||
|
|
||||||
_LOGGER.info("Build %s:%s done", self.image, tag)
|
_LOGGER.info("Build %s:%s done", self.image, tag)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user