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

cmd/scollector: skip md volumes if mdadm binary is missing #1850

Merged
merged 1 commit into from
Aug 5, 2016

Conversation

d10v
Copy link
Contributor

@d10v d10v commented Aug 4, 2016

Rarely there are /dev/md* files but no mdadm installed.

@@ -169,7 +169,10 @@ func examineMdadmVolume(volumeName string) (volumeDetail, error) {
// We don't use --test because it has failed us in the past.
// Maybe we should use it sometime in the future
output, err := util.Command(tmout, nil, "mdadm", "--detail", volumeName)
detail := parseExamineMdadm(output)
detail := volumeDetail{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor thing. I'm much more used to seeing if err != nil blocks. How about:

if err != nil{
   return volumeDetail{}, err
}
return parseExamineMdadm(output), nil

@d10v
Copy link
Contributor Author

d10v commented Aug 5, 2016

Thank you for a quick answer, Craig.
Yeah, your suggestion is way prettier.

@captncraig captncraig merged commit fa86001 into bosun-monitor:master Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants