Skip to content

Commit

Permalink
cli/storagegroup: print that storage group has no expiration epoch
Browse files Browse the repository at this point in the history
Since we get an expiration option from the object that carries the storage
group, and if it's not set we get `object.ErrNoExpiration`, now we print
information about it.

Signed-off-by: Andrey Butusov <[email protected]>
  • Loading branch information
End-rey committed Oct 4, 2024
1 parent 0504c96 commit 3ebb2d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/neofs-cli/modules/storagegroup/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ func getSG(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("storage group's expiration: %w", err)

Check warning on line 96 in cmd/neofs-cli/modules/storagegroup/get.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/storagegroup/get.go#L94-L96

Added lines #L94 - L96 were not covered by tests
}

cmd.Printf("The last active epoch: %d\n", expiration)
if errors.Is(err, object.ErrNoExpiration) {
cmd.Printf("No expiration epoch")
} else {
cmd.Printf("The last active epoch: %d\n", expiration)

Check warning on line 102 in cmd/neofs-cli/modules/storagegroup/get.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/storagegroup/get.go#L99-L102

Added lines #L99 - L102 were not covered by tests
}
cmd.Printf("Group size: %d\n", sg.ValidationDataSize())
common.PrintChecksum(cmd, "Group hash", sg.ValidationDataHash)

Expand Down

0 comments on commit 3ebb2d8

Please sign in to comment.