From 59eebc5eeb389038dccdd4944c466c9e3603eafd 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 9f952d4d1..e8df8793f 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))