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)
|
||||
}
|
||||
|
||||
var ctrPath string
|
||||
if cmd.Name() == "init" {
|
||||
if viper.GetInt64(epochDurationInitFlag) <= 0 {
|
||||
return nil, fmt.Errorf("epoch duration must be positive")
|
||||
|
@ -119,11 +120,11 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
|
|||
if viper.GetInt64(maxObjectSizeInitFlag) <= 0 {
|
||||
return nil, fmt.Errorf("max object size must be positive")
|
||||
}
|
||||
}
|
||||
|
||||
ctrPath, err := cmd.Flags().GetString(contractsInitFlag)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("missing contracts path: %w", err)
|
||||
ctrPath, err = cmd.Flags().GetString(contractsInitFlag)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("missing contracts path: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
ns, err := c.GetNativeContracts()
|
||||
|
|
Loading…
Reference in a new issue