This commit is contained in:
Xiang Li 2013-08-17 21:21:18 -07:00
parent 5357fb431e
commit 1527b7008c
3 changed files with 2 additions and 3 deletions

View File

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

View File

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

View File

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