[#1680] cli/netmap: Support MAINTENANCE mode

Make `netmap snapshot` command to print `MAINTENANCE` state of the nodes
with `IsMaintenance()` flag set.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-09-28 15:46:14 +04:00 committed by fyrchik
parent eb1fba5182
commit a7668618c9

View file

@ -42,10 +42,14 @@ func prettyPrintNetMap(cmd *cobra.Command, nm netmap.NetMap) {
var strState string var strState string
switch { switch {
default:
strState = "STATE_UNSUPPORTED"
case nodes[i].IsOnline(): case nodes[i].IsOnline():
strState = "ONLINE" strState = "ONLINE"
case nodes[i].IsOffline(): case nodes[i].IsOffline():
strState = "OFFLINE" strState = "OFFLINE"
case nodes[i].IsMaintenance():
strState = "MAINTENANCE"
} }
cmd.Printf("Node %d: %s %s ", i+1, hex.EncodeToString(nodes[i].PublicKey()), strState) cmd.Printf("Node %d: %s %s ", i+1, hex.EncodeToString(nodes[i].PublicKey()), strState)