From 9cc7667a5110c59c1ffda4b75d7667ca4628e4bb Mon Sep 17 00:00:00 2001 From: Jon Schlueter Date: Thu, 26 Jul 2018 12:56:54 -0400 Subject: build with --template-only to not require running docker service Add a try/except check and raise excpetion if not --template-only Reason for this is so that you can run kolla_build --template-only on a system with a user that doesn't have permissions to access docker or system may not have docker service running. The template only generation is ok because it doesn't specifically need the docker context Change-Id: I191f3e073d14e9ba5419a8a9b043e8afaa565e2a --- kolla/image/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kolla/image/build.py b/kolla/image/build.py index a690e98b5..513c31875 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -710,7 +710,12 @@ class KollaWorker(object): self.maintainer = conf.maintainer docker_kwargs = docker.utils.kwargs_from_env() - self.dc = docker.APIClient(version='auto', **docker_kwargs) + try: + self.dc = docker.APIClient(version='auto', **docker_kwargs) + except docker.errors.DockerException as e: + self.dc = None + if not conf.template_only: + raise e def _get_images_dir(self): possible_paths = ( -- cgit v1.2.3