improve post validation

pull/9054/head
Medya Gh 2020-08-21 14:29:19 -07:00
parent 135d7bd7e4
commit 0849b48b9c
1 changed files with 3 additions and 2 deletions

View File

@ -217,8 +217,9 @@ func postStartValidations(h *host.Host, drvName string) {
if err != nil {
glog.Warningf("error running df -h /var: %v", err)
}
output = strings.Trim(output, "\n")
percentageFull, err := strconv.Atoi(output[:len(output)-1])
output = strings.TrimSpace(output)
output = strings.Trim(output, "%")
percentageFull, err := strconv.Atoi(output)
if err != nil {
glog.Warningf("error getting percentage of /var that is free: %v", err)
}