Skip to content

Commit

Permalink
cluster: adjust error message of selinux check (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis authored Jul 14, 2021
1 parent 7031e03 commit 35998e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,15 @@ func CheckSELinux(ctx context.Context, e ctxt.Executor) *CheckResult {
return result
}
out := strings.Trim(string(stdout), "\n")
if lines, err := strconv.Atoi(out); err != nil || lines > 0 {
result.Err = fmt.Errorf("SELinux is not disabled, %d %s", lines, err)
lines, err := strconv.Atoi(out)
if err != nil {
result.Err = fmt.Errorf("can not check SELinux status, please validate manually, %s", err)
result.Warn = true
return result
}

if lines > 0 {
result.Err = fmt.Errorf("SELinux is not disabled")
} else {
result.Msg = "SELinux is disabled"
}
Expand Down

0 comments on commit 35998e0

Please sign in to comment.