Trim whitespace from IPMI output

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2022-08-24 15:42:30 -06:00
parent befb1ed815
commit db29b9ff3e

View File

@@ -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