Browse Source

etcdsever: mismatch error uses the same format as the corresponding flags

Xiang Li 10 years ago
parent
commit
2540a3fb7e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      etcdserver/config.go

+ 3 - 1
etcdserver/config.go

@@ -19,6 +19,7 @@ import (
 	"net/http"
 	"path"
 	"sort"
+	"strings"
 	"time"
 
 	"github.com/coreos/etcd/pkg/netutil"
@@ -102,7 +103,8 @@ func (c *ServerConfig) verifyLocalMember(strict bool) error {
 	urls.Sort()
 	if strict {
 		if !netutil.URLStringsEqual(apurls, urls.StringSlice()) {
-			return fmt.Errorf("--initial-cluster must include %s=%s given --initial-advertise-peer-urls=%s", c.Name, apurls, apurls)
+			umap := map[string]types.URLs{c.Name: c.PeerURLs}
+			return fmt.Errorf("--initial-cluster must include %s given --initial-advertise-peer-urls=%s", types.URLsMap(umap).String(), strings.Join(apurls, ","))
 		}
 	}
 	return nil