[#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>
remotes/fyrchik/neofs-adm-fix-commands
Leonard Lyubich 2022-09-28 15:46:14 +04:00 committed by fyrchik
parent eb1fba5182
commit a7668618c9
1 changed files with 4 additions and 0 deletions

View File

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