Browse Source

Merge pull request #498 from alouche/fix_sprintf_unreachable_code

Fix sprintf formatting and cleanup unreachable code
pull/499/head
Ryan Uber 10 years ago
parent
commit
9c92ea5bcb
  1. 2
      command/agent/command.go
  2. 1
      command/agent/dns.go
  3. 4
      command/agent/kvs_endpoint.go
  4. 1
      command/exec.go
  5. 4
      consul/fsm.go

2
command/agent/command.go

@ -310,7 +310,7 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *log
servers, err := NewHTTPServers(agent, config, logOutput)
if err != nil {
agent.Shutdown()
c.Ui.Error(fmt.Sprintf("Error starting http servers:", err))
c.Ui.Error(fmt.Sprintf("Error starting http servers: %s", err))
return err
}
c.httpServers = servers

1
command/agent/dns.go

@ -139,7 +139,6 @@ func NewDNSServer(agent *Agent, config *DNSConfig, logOutput io.Writer, domain s
case <-time.After(time.Second):
return srv, fmt.Errorf("timeout setting up DNS server")
}
return srv, nil
}
// recursorAddr is used to add a port to the recursor if omitted.

4
command/agent/kvs_endpoint.go

@ -3,11 +3,12 @@ package agent
import (
"bytes"
"fmt"
"github.com/hashicorp/consul/consul/structs"
"io"
"net/http"
"strconv"
"strings"
"github.com/hashicorp/consul/consul/structs"
)
const (
@ -50,7 +51,6 @@ func (s *HTTPServer) KVSEndpoint(resp http.ResponseWriter, req *http.Request) (i
resp.WriteHeader(405)
return nil, nil
}
return nil, nil
}
// KVSGet handles a GET request

1
command/exec.go

@ -384,7 +384,6 @@ func (c *ExecCommand) streamResults(doneCh chan struct{}, ackCh chan rExecAck, h
}
}
}
return
ERR_EXIT:
select {

4
consul/fsm.go

@ -167,7 +167,6 @@ func (c *consulFSM) applyKVSOperation(buf []byte, index uint64) interface{} {
c.logger.Printf("[WARN] consul.fsm: Invalid KVS operation '%s'", req.Op)
return fmt.Errorf("Invalid KVS operation '%s'", req.Op)
}
return nil
}
func (c *consulFSM) applySessionOperation(buf []byte, index uint64) interface{} {
@ -188,7 +187,6 @@ func (c *consulFSM) applySessionOperation(buf []byte, index uint64) interface{}
c.logger.Printf("[WARN] consul.fsm: Invalid Session operation '%s'", req.Op)
return fmt.Errorf("Invalid Session operation '%s'", req.Op)
}
return nil
}
func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
@ -211,7 +209,6 @@ func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
c.logger.Printf("[WARN] consul.fsm: Invalid ACL operation '%s'", req.Op)
return fmt.Errorf("Invalid ACL operation '%s'", req.Op)
}
return nil
}
func (c *consulFSM) Snapshot() (raft.FSMSnapshot, error) {
@ -443,7 +440,6 @@ func (s *consulSnapshot) persistKV(sink raft.SnapshotSink,
return err
}
}
return nil
}
func (s *consulSnapshot) Release() {

Loading…
Cancel
Save