Rename 'reclaim' to 'noErrorUnknown' which describes the behaviour better
This commit is contained in:
1 parent
647b755b64
commit
f0915221d1
4 files changed
+13
-14
No files matched your search
+2
-2
@@ -22,11 +22,11 @@ func (alloc *Allocator) HandleHTTP(router *mux.Router, defaultSubnet address.CID
|
||||
vars := mux.Vars(r)
|
||||
ident := vars["id"]
|
||||
ipStr := vars["ip"]
|
||||
reclaim := r.FormValue("reclaim") == "true"
|
||||
noErrorOnUnknown := r.FormValue("noErrorOnUnknown") == "true"
|
||||
if ip, err := address.ParseIP(ipStr); err != nil {
|
||||
badRequest(w, err)
|
||||
return
|
||||
} else if err := alloc.Claim(ident, ip, reclaim); err != nil {
|
||||
} else if err := alloc.Claim(ident, ip, noErrorOnUnknown); err != nil {
|
||||
badRequest(w, fmt.Errorf("Unable to claim: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user