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
This commit is contained in:
Swapnil Kulkarni (coolsvap) 2016-03-07 13:30:58 +05:30
parent 4d0fb0b7f6
commit 5669f7e0ad

View File

@ -73,8 +73,13 @@ class KollaRpmSetupUnknownConfig(Exception):
def docker_client(): def docker_client():
try:
docker_kwargs = docker.utils.kwargs_from_env() docker_kwargs = docker.utils.kwargs_from_env()
return docker.Client(version='auto', **docker_kwargs) 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): class PushThread(threading.Thread):