[#1889] Move netmap.go and exit.go from cli to cmd/internal/common

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-01-16 12:20:16 +03:00 committed by fyrchik
parent 5a9d6a09d8
commit 2b09564355
62 changed files with 269 additions and 247 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key"
objectCli "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/modules/object"
commonCmd "github.com/TrueCloudLab/frostfs-node/cmd/internal/common"
cid "github.com/TrueCloudLab/frostfs-sdk-go/container/id"
oid "github.com/TrueCloudLab/frostfs-sdk-go/object/id"
storagegroupSDK "github.com/TrueCloudLab/frostfs-sdk-go/storagegroup"
@ -57,7 +58,7 @@ func getSG(cmd *cobra.Command, _ []string) {
prm.SetPayloadWriter(buf)
res, err := internalclient.GetObject(prm)
common.ExitOnErr(cmd, "rpc error: %w", err)
commonCmd.ExitOnErr(cmd, "rpc error: %w", err)
rawObj := res.Header()
rawObj.SetPayload(buf.Bytes())
@ -65,7 +66,7 @@ func getSG(cmd *cobra.Command, _ []string) {
var sg storagegroupSDK.StorageGroup
err = storagegroupSDK.ReadFromObject(&sg, *rawObj)
common.ExitOnErr(cmd, "could not read storage group from the obj: %w", err)
commonCmd.ExitOnErr(cmd, "could not read storage group from the obj: %w", err)
cmd.Printf("The last active epoch: %d\n", sg.ExpirationEpoch())
cmd.Printf("Group size: %d\n", sg.ValidationDataSize())