From 5cdca40598710d68240643f14f80039d22a1a788 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Nov 2024 10:20:34 +0300 Subject: [PATCH] WIP: cli: Change --await flag semantics in control set-status Signed-off-by: Evgenii Stratonikov --- .../modules/control/set_netmap_status.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/frostfs-cli/modules/control/set_netmap_status.go b/cmd/frostfs-cli/modules/control/set_netmap_status.go index 87c4f3b3d..8cd763bf3 100644 --- a/cmd/frostfs-cli/modules/control/set_netmap_status.go +++ b/cmd/frostfs-cli/modules/control/set_netmap_status.go @@ -68,18 +68,20 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) { } await, _ := cmd.Flags().GetBool(commonflags.AwaitFlag) - var targetStatus control.NetmapStatus + body.SetAwait(await) + + // /var targetStatus control.NetmapStatus switch st, _ := cmd.Flags().GetString(netmapStatusFlag); st { default: commonCmd.ExitOnErr(cmd, "", fmt.Errorf("unsupported status %s", st)) case netmapStatusOnline: body.SetStatus(control.NetmapStatus_ONLINE) printIgnoreForce(control.NetmapStatus_ONLINE) - targetStatus = control.NetmapStatus_ONLINE + // targetStatus = control.NetmapStatus_ONLINE case netmapStatusOffline: body.SetStatus(control.NetmapStatus_OFFLINE) printIgnoreForce(control.NetmapStatus_OFFLINE) - targetStatus = control.NetmapStatus_OFFLINE + // targetStatus = control.NetmapStatus_OFFLINE case netmapStatusMaintenance: body.SetStatus(control.NetmapStatus_MAINTENANCE) @@ -87,7 +89,7 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) { body.SetForceMaintenance(true) common.PrintVerbose(cmd, "Local maintenance will be forced.") } - targetStatus = control.NetmapStatus_MAINTENANCE + // targetStatus = control.NetmapStatus_MAINTENANCE } req := new(control.SetNetmapStatusRequest) @@ -109,9 +111,9 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) { cmd.Println("Network status update request successfully sent.") - if await { - awaitSetNetmapStatus(cmd, pk, cli, targetStatus) - } + // if await { + // awaitSetNetmapStatus(cmd, pk, cli, targetStatus) + // } } func awaitSetNetmapStatus(cmd *cobra.Command, pk *ecdsa.PrivateKey, cli *client.Client, targetStatus control.NetmapStatus) {