From 7daa57d4d2281d8161469bacc4d852c2a68761f0 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 28 Oct 2022 21:30:39 +0300 Subject: [PATCH] [#1991] cli: Refine container placement description Not to confuse a user by mixing a replication vector number with its copy number. Signed-off-by: Pavel Karpy --- CHANGELOG.md | 1 + cmd/neofs-cli/modules/container/nodes.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb262bf4..fbfa7477c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Changelog for NeoFS Node ### Changed ### Fixed - Open FSTree in sync mode by default (#1992) +- `neofs-cli container nodes`'s output (#1991) ### Removed ### Updated diff --git a/cmd/neofs-cli/modules/container/nodes.go b/cmd/neofs-cli/modules/container/nodes.go index aa4bde57c..acc8bf5b5 100644 --- a/cmd/neofs-cli/modules/container/nodes.go +++ b/cmd/neofs-cli/modules/container/nodes.go @@ -39,12 +39,14 @@ var containerNodesCmd = &cobra.Command{ binCnr := make([]byte, sha256.Size) id.Encode(binCnr) + policy := cnr.PlacementPolicy() + var cnrNodes [][]netmap.NodeInfo - cnrNodes, err = resmap.NetMap().ContainerNodes(cnr.PlacementPolicy(), binCnr) + cnrNodes, err = resmap.NetMap().ContainerNodes(policy, binCnr) common.ExitOnErr(cmd, "could not build container nodes for given container: %w", err) for i := range cnrNodes { - cmd.Printf("Rep %d\n", i+1) + cmd.Printf("Descriptor #%d, REP %d:\n", i+1, policy.ReplicaNumberByIndex(i)) for j := range cnrNodes[i] { common.PrettyPrintNodeInfo(cmd, cnrNodes[i][j], j, "\t", short) }