From 2f3701693d9999bee6278f230b8a44b26a8fb708 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 11 Feb 2018 01:42:53 +0100 Subject: [PATCH] Fix bugs with docker api 3.0.1 and fix the version (#353) * Fix version * fix snapshot --- hassio/docker/addon.py | 11 ++++++++--- setup.py | 16 ++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/hassio/docker/addon.py b/hassio/docker/addon.py index 73c2b9583..1f6986a4e 100644 --- a/hassio/docker/addon.py +++ b/hassio/docker/addon.py @@ -269,9 +269,13 @@ class DockerAddon(DockerInterface): _LOGGER.info("Start build %s:%s", self.image, tag) try: - image = self._docker.images.build(**build_env.get_docker_args(tag)) + image, log = self._docker.images.build( + **build_env.get_docker_args(tag)) + _LOGGER.debug("Build %s:%s done: %s", self.image, tag, log) image.tag(self.image, tag='latest') + + # Update meta data self._meta = image.attrs except (docker.errors.DockerException) as err: @@ -297,15 +301,16 @@ class DockerAddon(DockerInterface): _LOGGER.error("Can't fetch image %s: %s", self.image, err) return False + _LOGGER.info("Export image %s to %s", self.image, tar_file) try: with tar_file.open("wb") as write_tar: - for chunk in image.stream(): + for chunk in image: write_tar.write(chunk) except (OSError, requests.exceptions.ReadTimeout) as err: _LOGGER.error("Can't write tar file %s: %s", tar_file, err) return False - _LOGGER.info("Export image %s to %s", self.image, tar_file) + _LOGGER.info("Export image %s done", self.image) return True @docker_process diff --git a/setup.py b/setup.py index ac212a027..ab6ad16ef 100644 --- a/setup.py +++ b/setup.py @@ -40,13 +40,13 @@ setup( ], include_package_data=True, install_requires=[ - 'async_timeout', - 'aiohttp', - 'docker', - 'colorlog', - 'voluptuous', - 'gitpython', - 'pytz', - 'pyudev' + 'async_timeout==2.0.0', + 'aiohttp==2.3.10', + 'docker==3.0.1', + 'colorlog==3.1.2', + 'voluptuous==0.10.5', + 'gitpython==2.1.8', + 'pytz==2018.3', + 'pyudev==0.21.0' ] )