From a77392e9ce561324456d7443ea0ff904f934e9f9 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 1 Nov 2022 20:20:11 +0300 Subject: [PATCH] [#1972] cli: Fix lifetime flag in the `lock` command That part of the code was refactored incorrectly. Signed-off-by: Pavel Karpy --- cmd/neofs-cli/modules/object/lock.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-cli/modules/object/lock.go b/cmd/neofs-cli/modules/object/lock.go index 1e148275..fcb37cbe 100644 --- a/cmd/neofs-cli/modules/object/lock.go +++ b/cmd/neofs-cli/modules/object/lock.go @@ -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))