[#1972] cli: Fix lifetime flag in the lock command

That part of the code was refactored incorrectly.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-11-01 20:20:11 +03:00 committed by fyrchik
parent f79386e538
commit 59eebc5eeb

View file

@ -63,9 +63,11 @@ var objectLockCmd = &cobra.Command{
currEpoch, err := internalclient.GetCurrentEpoch(ctx, endpoint)
common.ExitOnErr(cmd, "Request current epoch: %w", err)
exp += currEpoch
exp = currEpoch + lifetime
}
common.PrintVerbose("Lock object will expire at %d epoch", exp)
var expirationAttr objectSDK.Attribute
expirationAttr.SetKey(objectV2.SysAttributeExpEpoch)
expirationAttr.SetValue(strconv.FormatUint(exp, 10))