libmachine: return an error if DOCKER_HOST is empty

Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
This commit is contained in:
Soshi Katsuta 2015-07-30 19:12:26 +09:00
parent 7614212d4f
commit aba294cbb1
1 changed files with 4 additions and 0 deletions

View File

@ -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 {