Xiang Li 12 years ago
parent
commit
1527b7008c
3 changed files with 2 additions and 3 deletions
  1. 0 1
      etcd_handlers.go
  2. 1 1
      test/test.go
  3. 1 1
      third_party/github.com/coreos/go-etcd/etcd/client.go

+ 0 - 1
etcd_handlers.go

@@ -31,7 +31,6 @@ type errorHandler func(http.ResponseWriter, *http.Request) error
 
 func (fn errorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	if e := fn(w, r); e != nil {
-		fmt.Println(e)
 		if etcdErr, ok := e.(etcdErr.Error); ok {
 			debug("Return error: ", etcdErr.Error())
 			etcdErr.Write(w)

+ 1 - 1
test/test.go

@@ -176,7 +176,7 @@ func Monitor(size int, allowDeadNum int, leaderChan chan string, all chan bool,
 
 func getLeader(addr string) (string, error) {
 
-	resp, err := client.Get(addr + "/leader")
+	resp, err := client.Get(addr + "/v1/leader")
 
 	if err != nil {
 		return "", err

+ 1 - 1
third_party/github.com/coreos/go-etcd/etcd/client.go

@@ -116,7 +116,7 @@ func (c *Client) SyncCluster() bool {
 // sync cluster information by providing machine list
 func (c *Client) internalSyncCluster(machines []string) bool {
 	for _, machine := range machines {
-		httpPath := c.createHttpPath(machine, "machines")
+		httpPath := c.createHttpPath(machine, "v1/machines")
 		resp, err := c.httpClient.Get(httpPath)
 		if err != nil {
 			// try another machine in the cluster