From db29b9ff3e33f375614e74fe54d45119f2ce1ef6 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 24 Aug 2022 15:42:30 -0600 Subject: [PATCH] Trim whitespace from IPMI output Signed-off-by: Jonathon Anderson --- internal/pkg/power/ipmitool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/power/ipmitool.go b/internal/pkg/power/ipmitool.go index dcf33e66..ae647d50 100644 --- a/internal/pkg/power/ipmitool.go +++ b/internal/pkg/power/ipmitool.go @@ -3,6 +3,7 @@ package power import ( "os" "os/exec" + "strings" ) type IPMIResult struct { @@ -66,7 +67,7 @@ func (ipmi *IPMI) IPMIInteractiveCommand(args ...string) error { func (ipmi *IPMI) IPMICommand(args ...string) (string, error) { ipmiOut, err := ipmi.Command(args) - ipmi.result.out = string(ipmiOut) + ipmi.result.out = strings.TrimSpace(string(ipmiOut)) ipmi.result.err = err return ipmi.result.out, ipmi.result.err