Fix excessive line spacing issue when listing nodes
Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
d24a92965f
commit
aa8282ad10
@@ -32,11 +32,12 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err
|
||||
if vars.showYaml || vars.showJson {
|
||||
wwlog.Info(profileInfo.Output[0])
|
||||
} else {
|
||||
ph := helper.NewPrintHelper(strings.Split(profileInfo.Output[0], ":=:"))
|
||||
ph := helper.New(strings.Split(profileInfo.Output[0], ":=:"))
|
||||
for _, val := range profileInfo.Output[1:] {
|
||||
ph.Append(strings.Split(val, ":=:"))
|
||||
}
|
||||
ph.Render()
|
||||
wwlog.Info(ph.String())
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
@@ -222,11 +222,12 @@ nodes:
|
||||
}
|
||||
|
||||
func verifyOutput(t *testing.T, baseCmd *cobra.Command, content string) {
|
||||
baseCmd.SetOut(nil)
|
||||
baseCmd.SetErr(nil)
|
||||
stdoutR, stdoutW, _ := os.Pipe()
|
||||
oriout := os.Stdout
|
||||
os.Stdout = stdoutW
|
||||
wwlog.SetLogWriter(os.Stdout)
|
||||
baseCmd.SetOut(os.Stdout)
|
||||
baseCmd.SetErr(os.Stdout)
|
||||
err := baseCmd.Execute()
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user