Skip to content

Commit

Permalink
Merge pull request #8934 from rook/mergify/bp/release-1.7/pr-8933
Browse files Browse the repository at this point in the history
osd: do not hide errors (backport #8933)
  • Loading branch information
leseb committed Oct 8, 2021
2 parents f8d9f90 + 29115a9 commit 3755b85
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions pkg/util/sys/device.go
Expand Up @@ -209,18 +209,6 @@ func GetDevicePropertiesFromPath(devicePath string, executor exec.Executor) (map
output, err := executor.ExecuteCommandWithOutput("lsblk", devicePath,
"--bytes", "--nodeps", "--pairs", "--paths", "--output", "SIZE,ROTA,RO,TYPE,PKNAME,NAME,KNAME")
if err != nil {
// The "not a block device" error also returns code 32 so the ExitStatus() check hides this error
if strings.Contains(output, "not a block device") {
return nil, err
}

// try to get more information about the command error
if code, ok := exec.ExitStatus(err); ok && code == 32 {
// certain device types (such as loop) return exit status 32 when probed further,
// ignore and continue without logging
return map[string]string{}, nil
}

logger.Errorf("failed to execute lsblk. output: %s", output)
return nil, err
}
Expand Down

0 comments on commit 3755b85

Please sign in to comment.