Skip to content

Commit

Permalink
fix: add accidentally reverted suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy committed Oct 31, 2024
1 parent 9ddb836 commit edced75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/hostid/hostid.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ReadFile(dataDir string) (string, error) {
if err != nil {
if errors.Is(err, fs.ErrPermission) {
//do not convert to system error as this loses the ability to compare that it is a permission error
return "", err
return "", trace.Wrap(err)
}
return "", trace.ConvertSystemError(err)
}
Expand Down Expand Up @@ -80,7 +80,7 @@ func WriteFile(dataDir string, id string) error {
// returns the UUID from it, otherwise generates one
func ReadOrCreateFile(dataDir string) (string, error) {
hostUUIDFileLock := GetPath(dataDir) + ".lock"
iterationLimit := 3
const iterationLimit = 3

for i := 0; i < iterationLimit; i++ {
if read, err := ReadFile(dataDir); err == nil {
Expand Down

0 comments on commit edced75

Please sign in to comment.