cli: Fix netinfo output for empty unknown parameters #1236
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue
I personally think the perfect behaviour was fine (we expect hex, we get empty hex)
I think we should display the empty value (just like with namespace). What do you think about
nil
?The same thing to me.
But if everyone agrees we need this,
empty
would be less Go-specific.@aarifullin / @dstepanov-yadro / @elebedeva What do you think?
We should keep in mind that any cli output may be parsed (like test results).
and
As we can see these output results are not the same format. Either we need to frame non-nil output to quotes or omit it for the first case. I think if we keep it in current format - that's OK.