[#1236] cli: Fix netinfo output for empty unknown parameters
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m18s
DCO action / DCO (pull_request) Successful in 3m20s
Build / Build Components (1.21) (pull_request) Successful in 5m0s
Build / Build Components (1.22) (pull_request) Successful in 5m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 6m19s
Tests and linters / Staticcheck (pull_request) Successful in 6m46s
Tests and linters / gopls check (pull_request) Successful in 6m45s
Tests and linters / Lint (pull_request) Successful in 7m39s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m2s
Tests and linters / Tests (1.22) (pull_request) Successful in 9m3s
Tests and linters / Tests with -race (pull_request) Successful in 10m28s

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.Printf(format, "Maintenance mode allowed", netInfo.MaintenanceModeAllowed())
cmd.Println("FrostFS network configuration (other)") cmd.Println("FrostFS network configuration (other)")
netInfo.IterateRawNetworkParameters(func(name string, value []byte) { netInfo.IterateRawNetworkParameters(func(name string, rawValue []byte) {
cmd.Printf(format, name, hex.EncodeToString(value)) value := hex.EncodeToString(rawValue)
if value == "" {
value = `""`
}
cmd.Printf(format, name, value)
}) })
}, },
} }