Fix excessive line spacing issue when listing nodes

Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
xu yang
2024-09-24 04:08:30 +00:00
committed by Jonathon Anderson
parent d24a92965f
commit aa8282ad10
9 changed files with 78 additions and 72 deletions

View File

@@ -40,11 +40,12 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err
if req.Type == wwapiv1.GetNodeList_YAML || req.Type == wwapiv1.GetNodeList_JSON {
wwlog.Info(nodeInfo.Output[0])
} else {
ph := helper.NewPrintHelper(strings.Split(nodeInfo.Output[0], ":=:"))
ph := helper.New(strings.Split(nodeInfo.Output[0], ":=:"))
for _, val := range nodeInfo.Output[1:] {
ph.Append(strings.Split(val, ":=:"))
}
ph.Render()
wwlog.Info(ph.String())
}
}
return