From 35998e002049af0fa90cf921b787b24b891995b7 Mon Sep 17 00:00:00 2001 From: Allen Zhong Date: Wed, 14 Jul 2021 11:27:32 +0800 Subject: [PATCH] cluster: adjust error message of selinux check (#1476) --- pkg/cluster/operation/check.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/operation/check.go b/pkg/cluster/operation/check.go index 09e357af63..7a833f06d2 100644 --- a/pkg/cluster/operation/check.go +++ b/pkg/cluster/operation/check.go @@ -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" }