[#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

@ -5,6 +5,7 @@ import (
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common"
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
commonCmd "github.com/TrueCloudLab/frostfs-node/cmd/internal/common"
"github.com/spf13/cobra"
)
@ -36,10 +37,10 @@ func convertEACLTable(cmd *cobra.Command, _ []string) {
var err error
if jsonFlag || len(to) == 0 {
data, err = table.MarshalJSON()
common.ExitOnErr(cmd, "can't JSON encode extended ACL table: %w", err)
commonCmd.ExitOnErr(cmd, "can't JSON encode extended ACL table: %w", err)
} else {
data, err = table.Marshal()
common.ExitOnErr(cmd, "can't binary encode extended ACL table: %w", err)
commonCmd.ExitOnErr(cmd, "can't binary encode extended ACL table: %w", err)
}
if len(to) == 0 {
@ -48,7 +49,7 @@ func convertEACLTable(cmd *cobra.Command, _ []string) {
}
err = os.WriteFile(to, data, 0644)
common.ExitOnErr(cmd, "can't write exteded ACL table to file: %w", err)
commonCmd.ExitOnErr(cmd, "can't write exteded ACL table to file: %w", err)
cmd.Printf("extended ACL table was successfully dumped to %s\n", to)
}