Skip to content

Commit a3b361b

Browse files
committed
fix(etcd.go): back out cookoo.Params short-circuit
see https://github.com/deis/builder/pull/18/files#r47149280 for history
1 parent adc9522 commit a3b361b

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

pkg/etcd/etcd.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"net/http"
99
"os"
1010
"os/exec"
11-
"strconv"
1211
"strings"
1312
"time"
1413

@@ -71,20 +70,12 @@ type GetterSetter interface {
7170
// Returns:
7271
// This puts an *etcd.Client into the context.
7372
func CreateClient(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
74-
host := os.Getenv(hostEnvVar)
75-
port, err := strconv.Atoi(os.Getenv(portEnvVar))
76-
if host == "" {
77-
host = defaultHost
78-
}
79-
if err != nil {
80-
port = 4001
73+
url, ok := p.Get("url", "http://localhost:4001").(string)
74+
if !ok {
75+
fmt.Println("ERROR: 'url' param was not a string")
76+
os.Exit(1)
8177
}
8278

83-
// Aaron(12/9/2015): to shame me into fixing this later, but it's a bigger change
84-
fmt.Println("Aaron hasn't fixed the env var collection stage in the cookoo route yet...")
85-
// url := p.Get("url", "http://localhost:4001").(string)
86-
url := fmt.Sprintf("%s:%d", host, port)
87-
8879
// Backed this out because it's unnecessary so far.
8980
//hosts := p.Get("urls", []string{"http://localhost:4001"}).([]string)
9081
hosts := []string{url}

0 commit comments

Comments
 (0)