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 54add95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 All @@ -69,7 +69,7 @@ func WriteFile(dataDir string, id 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 All @@ -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 54add95

Please sign in to comment.