forked from TrueCloudLab/frostfs-node
[#732] neofs-adm: read contract path only on init
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
a2f6e07b1d
commit
e2cef00497
1 changed files with 5 additions and 4 deletions
|
@ -111,6 +111,7 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
|
||||||
return nil, fmt.Errorf("can't find consensus account: %w", err)
|
return nil, fmt.Errorf("can't find consensus account: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ctrPath string
|
||||||
if cmd.Name() == "init" {
|
if cmd.Name() == "init" {
|
||||||
if viper.GetInt64(epochDurationInitFlag) <= 0 {
|
if viper.GetInt64(epochDurationInitFlag) <= 0 {
|
||||||
return nil, fmt.Errorf("epoch duration must be positive")
|
return nil, fmt.Errorf("epoch duration must be positive")
|
||||||
|
@ -119,12 +120,12 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
|
||||||
if viper.GetInt64(maxObjectSizeInitFlag) <= 0 {
|
if viper.GetInt64(maxObjectSizeInitFlag) <= 0 {
|
||||||
return nil, fmt.Errorf("max object size must be positive")
|
return nil, fmt.Errorf("max object size must be positive")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ctrPath, err := cmd.Flags().GetString(contractsInitFlag)
|
ctrPath, err = cmd.Flags().GetString(contractsInitFlag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("missing contracts path: %w", err)
|
return nil, fmt.Errorf("missing contracts path: %w", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ns, err := c.GetNativeContracts()
|
ns, err := c.GetNativeContracts()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue