From 79fc90b6463d9b20391b4edd1540bc0a8e84da6f Mon Sep 17 00:00:00 2001 From: shin- Date: Mon, 12 Aug 2013 19:52:09 +0200 Subject: [PATCH] brew: Don't build if docker daemon can't be reached --- contrib/brew/brew/brew.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/brew/brew/brew.py b/contrib/brew/brew/brew.py index 352d20c77..e07fdfdbb 100644 --- a/contrib/brew/brew/brew.py +++ b/contrib/brew/brew/brew.py @@ -32,6 +32,15 @@ def build_library(repository=None, branch=None, namespace=None, push=False, logger.info('Repository provided assumed to be a local path') dst_folder = repository + try: + client.version() + except Exception as e: + logger.error('Could not reach the docker daemon. Please make sure it ' + 'is running.') + logger.warning('Also make sure you have access to the docker UNIX ' + 'socket (use sudo)') + return + #FIXME: set destination folder and only pull latest changes instead of # cloning the whole repo everytime if not dst_folder: