new weave status, weave status ..., and weave report

This commit is contained in:
Adam Harrison authored and Matthias Radestock committed 2015-08-11 12:15:13 +01:00
1 parent 00ecff09f7
commit fc9a1c8664
27 files changed
+784 -493

No files matched your search

+2 -10
View File
@@ -3,18 +3,10 @@ package router
import (
"fmt"
"github.com/gorilla/mux"
"github.com/weaveworks/weave/common"
"net/http"
"strings"
)
func errorMessages(errors []error) string {
var result []string
for _, err := range errors {
result = append(result, err.Error())
}
return strings.Join(result, "\n")
}
func (router *Router) HandleHTTP(muxRouter *mux.Router) {
muxRouter.Methods("POST").Path("/connect").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -22,7 +14,7 @@ func (router *Router) HandleHTTP(muxRouter *mux.Router) {
http.Error(w, fmt.Sprint("unable to parse form: ", err), http.StatusBadRequest)
}
if errors := router.ConnectionMaker.InitiateConnections(r.Form["peer"], r.FormValue("replace") == "true"); len(errors) > 0 {
http.Error(w, errorMessages(errors), http.StatusBadRequest)
http.Error(w, common.ErrorMessages(errors), http.StatusBadRequest)
}
})