Remove trailing newline from wwlog
I noticed that some wwlog calls included a trailing newline, but others did not. I tested both in isolation and discovered that the behavior was consistent regardless of whether a trailing newline was included. I further confirmed in code that wwlog appends a trailing newline automatically if it is not present; so a trailing newline is unnecessary in individual calls. This commit removes trailing newlines from all calls to make them consistent. It also replaces two calls to wwlog.Printf. (see #534) Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -21,12 +21,12 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
|
||||
controller, err := warewulfconf.New()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if controller.Ipaddr == "" {
|
||||
wwlog.Error("The Warewulf Server IP Address is not properly configured\n")
|
||||
wwlog.Error("The Warewulf Server IP Address is not properly configured")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
fmt.Print("\033[H\033[2J")
|
||||
_, height, err = term.GetSize(0)
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not get terminal height, using 24\n")
|
||||
wwlog.Warn("Could not get terminal height, using 24")
|
||||
height = 24
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
fmt.Printf("%-20s %-20s %-25s %-10s\n", "NODENAME", "STAGE", "SENT", "LASTSEEN (s)")
|
||||
fmt.Printf("%s\n", strings.Repeat("=", 80))
|
||||
|
||||
wwlog.Verbose("Building sort index\n")
|
||||
wwlog.Verbose("Building sort index")
|
||||
var statuses []*wwapiv1.NodeStatus
|
||||
if len(args) > 0 {
|
||||
nodeList := hostlist.Expand(args)
|
||||
@@ -72,7 +72,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
wwlog.Verbose("Sorting index\n")
|
||||
wwlog.Verbose("Sorting index")
|
||||
if SetSortLast {
|
||||
sort.Slice(statuses, func(i, j int) bool {
|
||||
if statuses[i].Lastseen > statuses[j].Lastseen {
|
||||
@@ -84,7 +84,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
}
|
||||
})
|
||||
} else if SetSortReverse {
|
||||
wwlog.Verbose("Reversing sort order\n")
|
||||
wwlog.Verbose("Reversing sort order")
|
||||
sort.Slice(statuses, func(i, j int) bool {
|
||||
return statuses[i].NodeName > statuses[j].NodeName
|
||||
})
|
||||
@@ -95,7 +95,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
})
|
||||
}
|
||||
|
||||
wwlog.Verbose("Printing results\n")
|
||||
wwlog.Verbose("Printing results")
|
||||
for i := 0; i < len(statuses); i++ {
|
||||
o := statuses[i]
|
||||
if SetTime > 0 && o.Lastseen < SetTime {
|
||||
|
||||
Reference in New Issue
Block a user