From aba294cbb1ec4af8f35e9403fc3c4bd328255735 Mon Sep 17 00:00:00 2001 From: Soshi Katsuta Date: Thu, 30 Jul 2015 19:12:26 +0900 Subject: [PATCH] libmachine: return an error if DOCKER_HOST is empty Signed-off-by: Soshi Katsuta --- libmachine/filestore.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmachine/filestore.go b/libmachine/filestore.go index d2c4115848..aa2651ff68 100644 --- a/libmachine/filestore.go +++ b/libmachine/filestore.go @@ -126,6 +126,10 @@ func (s Filestore) GetActive() (*Host, error) { } dockerHost := os.Getenv("DOCKER_HOST") + if dockerHost == "" { + return nil, errors.New("DOCKER_HOST not set") + } + hostListItems := GetHostListItems(hosts) for _, item := range hostListItems {