From 5669f7e0ad2e31c68d18e326bc8b21507294f424 Mon Sep 17 00:00:00 2001 From: "Swapnil Kulkarni (coolsvap)" Date: Mon, 7 Mar 2016 13:30:58 +0530 Subject: [PATCH] Handle kolla-build exception kolla-build currently does not provide information if docker service is not running. Added exception handling. Change-Id: I1f167804b8b4d2ad9220281954ff7ea7162a9817 Closes-Bug:#1553912 --- kolla/cmd/build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 42eaa3011a..d21109647d 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -73,8 +73,13 @@ class KollaRpmSetupUnknownConfig(Exception): def docker_client(): - docker_kwargs = docker.utils.kwargs_from_env() - return docker.Client(version='auto', **docker_kwargs) + try: + docker_kwargs = docker.utils.kwargs_from_env() + return docker.Client(version='auto', **docker_kwargs) + except docker.errors.DockerException: + LOG.exception('Can not communicate with docker service.' + 'Please check docker service is running without errors') + sys.exit(1) class PushThread(threading.Thread):