mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 09:46:29 +00:00
Bugfix attach container/image (#52)
This commit is contained in:
parent
f34ab9402b
commit
5c0eccd12f
@ -97,15 +97,27 @@ class DockerAddon(DockerBase):
|
|||||||
|
|
||||||
Need run inside executor.
|
Need run inside executor.
|
||||||
"""
|
"""
|
||||||
|
# read container
|
||||||
try:
|
try:
|
||||||
self.container = self.dock.containers.get(self.docker_name)
|
self.container = self.dock.containers.get(self.docker_name)
|
||||||
self.process_metadata()
|
self.process_metadata()
|
||||||
|
|
||||||
_LOGGER.info(
|
_LOGGER.info("Attach to container %s with version %s",
|
||||||
"Attach to image %s with version %s", self.image, self.version)
|
self.image, self.version)
|
||||||
|
return
|
||||||
except (docker.errors.DockerException, KeyError):
|
except (docker.errors.DockerException, KeyError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# read image
|
||||||
|
try:
|
||||||
|
image = self.dock.images.get(self.image)
|
||||||
|
self.process_metadata(metadata=image.attrs)
|
||||||
|
|
||||||
|
_LOGGER.info("Attach to image %s with version %s",
|
||||||
|
self.image, self.version)
|
||||||
|
except (docker.errors.DockerException, KeyError):
|
||||||
|
_LOGGER.error("No container/image found for %s", self.image)
|
||||||
|
|
||||||
def _install(self, tag):
|
def _install(self, tag):
|
||||||
"""Pull docker image or build it.
|
"""Pull docker image or build it.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user