fix validator for type not being inverted
This commit is contained in:
parent
0e4757c7b7
commit
8bcb14a8af
@ -36,7 +36,7 @@ func ReserveV4MacAddr(identifierType string, identifier string, addr string, hos
|
|||||||
// This does not validate against the database, just validates that the written configuration
|
// This does not validate against the database, just validates that the written configuration
|
||||||
// is correct
|
// is correct
|
||||||
func (r *ReservationV4) Validate() bool {
|
func (r *ReservationV4) Validate() bool {
|
||||||
if typeValidator.IsValid(r.typeName) {
|
if !typeValidator.IsValid(r.typeName) {
|
||||||
slog.Error("validate", slog.Any("reservationV4.type", "invalid"))
|
slog.Error("validate", slog.Any("reservationV4.type", "invalid"))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@ package types
|
|||||||
import "git.staur.ca/stobbsm/kea-manage/lib/types"
|
import "git.staur.ca/stobbsm/kea-manage/lib/types"
|
||||||
|
|
||||||
func IsValid(identifierType string) bool {
|
func IsValid(identifierType string) bool {
|
||||||
return types.LookupIdentifier(identifierType) != 255
|
return types.LookupIdentifier(identifierType) != types.Invalid
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user