Browse Source

style comments

Barak Michener 11 years ago
parent
commit
cb5a638c44
3 changed files with 6 additions and 8 deletions
  1. 4 3
      etcdserver/config.go
  2. 1 4
      etcdserver/member.go
  3. 1 1
      main.go

+ 4 - 3
etcdserver/config.go

@@ -41,6 +41,10 @@ type ServerConfig struct {
 // VerifyBootstrapConfig sanity-checks the initial config and returns an error
 // for things that should never happen.
 func (c *ServerConfig) VerifyBootstrapConfig() error {
+	if c.NodeID == raft.None {
+		return fmt.Errorf("could not use %x as member id", raft.None)
+	}
+
 	if c.DiscoveryURL == "" && c.ClusterState != ClusterStateValueNew {
 		return fmt.Errorf("initial cluster state unset and no wal or discovery URL found")
 	}
@@ -55,9 +59,6 @@ func (c *ServerConfig) VerifyBootstrapConfig() error {
 	if !isOk {
 		return fmt.Errorf("couldn't find local ID in cluster config")
 	}
-	if c.NodeID == raft.None {
-		return fmt.Errorf("could not use %x as member id", raft.None)
-	}
 
 	// No identical IPs in the cluster peer list
 	urlMap := make(map[string]bool)

+ 1 - 4
etcdserver/member.go

@@ -61,10 +61,7 @@ func newMember(name string, peerURLs types.URLs, clusterName string, now *time.T
 		b = append(b, []byte(p)...)
 	}
 
-	if clusterName != "" {
-		b = append(b, []byte(clusterName)...)
-	}
-
+	b = append(b, []byte(clusterName)...)
 	if now != nil {
 		b = append(b, []byte(fmt.Sprintf("%d", now.Unix()))...)
 	}

+ 1 - 1
main.go

@@ -291,7 +291,7 @@ func setupCluster() (*etcdserver.Member, error) {
 				return c, nil
 			}
 		}
-		return nil, fmt.Errorf("etcd: cannot find the passed name %s in --initial-cluster bootstrap list.", *name)
+		return nil, fmt.Errorf("cannot find the passed name %s in --initial-cluster bootstrap list.", *name)
 	}
 	return cluster.FindName(*name), nil
 }