fixed network tests that failed with nodes

This commit is contained in:
Matthew R Kasun
2021-04-24 18:03:26 -04:00
parent f28937c1f6
commit ae826002cd
6 changed files with 1165 additions and 721 deletions

View File

@@ -387,6 +387,12 @@ func checkIn(w http.ResponseWriter, r *http.Request) {
}
//TODO: check node last modified vs network last modified
//Get Updated node to return
node, err = GetNode(params["macaddress"], params["network"])
if err != nil {
returnErrorResponse(w, r, formatError(err, "internal"))
return
}
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(node)
@@ -660,6 +666,10 @@ func validateGateway(gateway models.GatewayRequest) error {
if empty || !isIpv4 {
err = errors.New("IP Range Not Valid")
}
empty = gateway.Interface == ""
if empty {
err = errors.New("Interface cannot be empty")
}
return err
}