diff options
| author | Jon Schlueter <jschluet@redhat.com> | 2018-07-26 12:56:54 -0400 |
|---|---|---|
| committer | Jon Schlueter <jschluet@redhat.com> | 2018-07-26 13:27:02 -0400 |
| commit | 9cc7667a5110c59c1ffda4b75d7667ca4628e4bb (patch) | |
| tree | c07a0c1833487923384543045cca73b67b17cdcf /kolla | |
| parent | 2aefc3d8fae53fac6d354d42c230eeff8815e96d (diff) | |
| download | kolla-9cc7667a5110c59c1ffda4b75d7667ca4628e4bb.tar.gz kolla-9cc7667a5110c59c1ffda4b75d7667ca4628e4bb.zip | |
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
Diffstat (limited to 'kolla')
| -rwxr-xr-x | kolla/image/build.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 = ( |
