Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: do not hide errors #8933

Merged
merged 1 commit into from Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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