[#1236] cli: Fix netinfo output for empty unknown parameters

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-07-09 12:25:29 +03:00
parent 8eb591d668
commit afeaf01cea

View file

@ -50,8 +50,12 @@ var netInfoCmd = &cobra.Command{
cmd.Printf(format, "Maintenance mode allowed", netInfo.MaintenanceModeAllowed())
cmd.Println("FrostFS network configuration (other)")
netInfo.IterateRawNetworkParameters(func(name string, value []byte) {
cmd.Printf(format, name, hex.EncodeToString(value))
netInfo.IterateRawNetworkParameters(func(name string, rawValue []byte) {
value := hex.EncodeToString(rawValue)
if value == "" {
value = `""`
}
cmd.Printf(format, name, value)
})
},
}