add 'weave connect --replace ...'

This commit is contained in:
Paul Bellamy committed 2015-05-29 15:44:45 +01:00
1 parent 6e2bb075a6
commit 858356de22
5 files changed
+37 -22

No files matched your search

+2 -2
View File
@@ -144,7 +144,7 @@ func main() {
}
router.Start()
if errors := router.ConnectionMaker.InitiateConnections(peers); len(errors) > 0 {
if errors := router.ConnectionMaker.InitiateConnections(peers, false); len(errors) > 0 {
log.Fatal(errorMessages(errors))
}
@@ -256,7 +256,7 @@ func handleHTTP(router *weave.Router, httpAddr string, allocator *ipam.Allocator
if err := r.ParseForm(); err != nil {
http.Error(w, fmt.Sprint("unable to parse form: ", err), http.StatusBadRequest)
}
if errors := router.ConnectionMaker.InitiateConnections(r.Form["peer"]); len(errors) > 0 {
if errors := router.ConnectionMaker.InitiateConnections(r.Form["peer"], r.FormValue("replace") == "true"); len(errors) > 0 {
http.Error(w, errorMessages(errors), http.StatusBadRequest)
}
})