[#1518] Upgrade NeoFS SDK Go with changed subnet
package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f602d05b0a
commit
2e4a1cb6df
12 changed files with 32 additions and 90 deletions
|
@ -141,10 +141,12 @@ It will be stored in sidechain when inner ring will accepts it.`,
|
|||
placementPolicy, err := parseContainerPolicy(containerPolicy)
|
||||
common.ExitOnErr(cmd, "", err)
|
||||
|
||||
subnetID, err := parseSubnetID(containerSubnet)
|
||||
var subnetID subnetid.ID
|
||||
|
||||
err = subnetID.DecodeString(containerSubnet)
|
||||
common.ExitOnErr(cmd, "could not parse subnetID: %w", err)
|
||||
|
||||
placementPolicy.SetSubnetID(subnetID)
|
||||
placementPolicy.SetSubnetID(&subnetID)
|
||||
|
||||
attributes, err := parseAttributes(containerAttributes)
|
||||
common.ExitOnErr(cmd, "", err)
|
||||
|
@ -596,16 +598,6 @@ func prettyPrintContainerList(cmd *cobra.Command, list []cid.ID) {
|
|||
}
|
||||
}
|
||||
|
||||
func parseSubnetID(val string) (sub *subnetid.ID, err error) {
|
||||
sub = &subnetid.ID{}
|
||||
|
||||
if val != "" {
|
||||
err = sub.UnmarshalText([]byte(val))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func parseContainerPolicy(policyString string) (*netmap.PlacementPolicy, error) {
|
||||
_, err := os.Stat(policyString) // check if `policyString` is a path to file with placement policy
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue