mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-07 17:26:32 +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.
|
||||
"""
|
||||
# read container
|
||||
try:
|
||||
self.container = self.dock.containers.get(self.docker_name)
|
||||
self.process_metadata()
|
||||
|
||||
_LOGGER.info(
|
||||
"Attach to image %s with version %s", self.image, self.version)
|
||||
_LOGGER.info("Attach to container %s with version %s",
|
||||
self.image, self.version)
|
||||
return
|
||||
except (docker.errors.DockerException, KeyError):
|
||||
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):
|
||||
"""Pull docker image or build it.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user