forked from TrueCloudLab/frostfs-node
[#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 <carpawell@nspcc.ru>
This commit is contained in:
parent
51e3810285
commit
7daa57d4d2
2 changed files with 5 additions and 2 deletions
|
@ -9,6 +9,7 @@ Changelog for NeoFS Node
|
||||||
### Changed
|
### Changed
|
||||||
### Fixed
|
### Fixed
|
||||||
- Open FSTree in sync mode by default (#1992)
|
- Open FSTree in sync mode by default (#1992)
|
||||||
|
- `neofs-cli container nodes`'s output (#1991)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
### Updated
|
### Updated
|
||||||
|
|
|
@ -39,12 +39,14 @@ var containerNodesCmd = &cobra.Command{
|
||||||
binCnr := make([]byte, sha256.Size)
|
binCnr := make([]byte, sha256.Size)
|
||||||
id.Encode(binCnr)
|
id.Encode(binCnr)
|
||||||
|
|
||||||
|
policy := cnr.PlacementPolicy()
|
||||||
|
|
||||||
var cnrNodes [][]netmap.NodeInfo
|
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)
|
common.ExitOnErr(cmd, "could not build container nodes for given container: %w", err)
|
||||||
|
|
||||||
for i := range cnrNodes {
|
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] {
|
for j := range cnrNodes[i] {
|
||||||
common.PrettyPrintNodeInfo(cmd, cnrNodes[i][j], j, "\t", short)
|
common.PrettyPrintNodeInfo(cmd, cnrNodes[i][j], j, "\t", short)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue