Skip to content

Commit

Permalink
fix: daemon,o/devicestate: move user creation and removal helpers to …
Browse files Browse the repository at this point in the history
…o/devicestate
  • Loading branch information
kubiko committed Jun 15, 2022
1 parent d418853 commit b993431
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion overlord/devicestate/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package devicestate

import (
"encoding/json"
"errors"
"fmt"
"os/user"
"path/filepath"
Expand Down Expand Up @@ -96,7 +97,7 @@ func CreateUser(st *state.State, mgr *DeviceManager, sudoer bool, createKnown bo
st.Lock()
serial, err = mgr.Serial()
st.Unlock()
if err != nil && err != state.ErrNoState {
if err != nil && !errors.Is(err, state.ErrNoState) {
return nil, internal_err, fmt.Errorf("cannot create user: cannot get serial: %v", err)
}
}
Expand Down

0 comments on commit b993431

Please sign in to comment.