aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorrthallisey <rhallise@redhat.com>2015-08-24 11:01:25 -0400
committerrthallisey <rhallise@redhat.com>2015-08-25 08:15:23 -0400
commit2b00ba41190ed771c84526c5c4b8dda47f676fff (patch)
treec7dcbd45127a7dd9e4ffd9081b61a35906854d43 /kolla
parenteb05118a3ffd4e0e9fc622a82aa07eb27e7fd723 (diff)
downloadkolla-2b00ba41190ed771c84526c5c4b8dda47f676fff.tar.gz
kolla-2b00ba41190ed771c84526c5c4b8dda47f676fff.zip
Fail faster when docker isn't running
In order to make build.py more friendly, have it fail faster when the script is unable to connect to Docker because it's not running. Change-Id: I6d480e601ea2511df9396fcf4e89c06c06d4c21c Closes-Bug: #1488133
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/cmd/build.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index b90767366..12ee12868 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -32,6 +32,7 @@ import time
import docker
import jinja2
+from requests.exceptions import ConnectionError
logging.basicConfig()
LOG = logging.getLogger(__name__)
@@ -68,6 +69,13 @@ class WorkerThread(Thread):
self.queue.task_done()
except Queue.Empty:
break
+ except ConnectionError as e:
+ LOG.error(e)
+ LOG.error('Make sure Docker is running and that you have '
+ 'the correct privileges to run Docker (root)')
+ data['status'] = "connection_error"
+ self.queue.task_done()
+ break
def process_source(self, source, dest_dir):
if source.get('type') == 'url':
@@ -89,7 +97,10 @@ class WorkerThread(Thread):
image['status'] = "building"
if image['parent'] is not None and \
- image['parent']['status'] in ['error', 'parent_error']:
+ image['parent']['status'] in ['error', 'parent_error',
+ 'connection_error']:
+ LOG.error('Parent image error\'d with message "%s"',
+ image['parent']['status'])
image['status'] = "parent_error"
return