mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-26 22:25:52 -05:00
Simplify register function if
This commit is contained in:
parent
74044f62f4
commit
5cbd4513a4
@ -61,7 +61,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// For the time being this method is rather naive.
|
// For the time being this method is rather naive.
|
||||||
func (machine Machine) isAlreadyRegistered() bool {
|
func (machine Machine) isRegistered() bool {
|
||||||
return machine.Registered
|
return machine.Registered
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ func (h *Headscale) RegisterMachine(
|
|||||||
Str("machine", machine.Name).
|
Str("machine", machine.Name).
|
||||||
Msg("Attempting to register machine")
|
Msg("Attempting to register machine")
|
||||||
|
|
||||||
if machine.isAlreadyRegistered() {
|
if machine.isRegistered() {
|
||||||
err := errMachineAlreadyRegistered
|
err := errMachineAlreadyRegistered
|
||||||
log.Error().
|
log.Error().
|
||||||
Caller().
|
Caller().
|
||||||
|
Loading…
Reference in New Issue
Block a user