mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: clean code
This commit is contained in:
parent
3162ead7b1
commit
5014558b00
@ -126,7 +126,7 @@ func (s *clusterStore) Remove(id uint64) {
|
||||
log.Panicf("delete peer should never fail: %v", err)
|
||||
}
|
||||
if _, err := s.Store.Create(removedMemberStoreKey(id), false, "", false, store.Permanent); err != nil {
|
||||
log.Panicf("unexpected creating removed member error: %v", err)
|
||||
log.Panicf("creating RemovedMember should never fail: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ func (h serverHandler) serveRaft(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("etcdhttp: error processing raft message:", err)
|
||||
switch err {
|
||||
case etcdserver.ErrRemoved:
|
||||
http.Error(w, "unexpected message from removed node", http.StatusForbidden)
|
||||
http.Error(w, "cannot process message from removed node", http.StatusForbidden)
|
||||
default:
|
||||
writeError(w, err)
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"path"
|
||||
"reflect"
|
||||
"sync"
|
||||
"testing"
|
||||
@ -967,7 +968,7 @@ func TestPublish(t *testing.T) {
|
||||
t.Errorf("method = %s, want PUT", r.Method)
|
||||
}
|
||||
wm := Member{ID: 1, Attributes: Attributes{Name: "node1", ClientURLs: []string{"http://a", "http://b"}}}
|
||||
if w := memberStoreKey(wm.ID) + attributesSuffix; r.Path != w {
|
||||
if w := path.Join(memberStoreKey(wm.ID), attributesSuffix); r.Path != w {
|
||||
t.Errorf("path = %s, want %s", r.Path, w)
|
||||
}
|
||||
var gattr Attributes
|
||||
|
Loading…
x
Reference in New Issue
Block a user