Merge pull request #11235 from zhaoxiangchun/automated-cherry-pick-of-#11233-upstream-release-3.7

Automated cherry pick of #11233: fix(host): raid status fix
This commit is contained in:
Zexi Li
2021-05-27 19:36:23 +08:00
committed by GitHub
+3 -7
View File
@@ -111,14 +111,10 @@ func (dev *MegaRaidPhyDev) parseLine(line string) bool {
case "Inquiry Data":
dev.Model = strings.Join(regexp.MustCompile(`\s+`).Split(val, -1), " ")
case "Firmware state":
if val == "JBOD" {
dev.Status = "jbod"
} else if strings.Contains(strings.ToLower(val), "online") {
dev.Status = "online"
} else if val == "Rebuild" {
dev.Status = "rebuild"
} else {
if strings.Contains(strings.ToLower(val), "offline") {
dev.Status = "offline"
} else {
dev.Status = "online"
}
case "Logical Sector Size":
block, err := strconv.Atoi(val)