[#1978] cli: Add children to the static session on DELETE
If an external session is provided and is not opened by CLI itself, add children objects to it too. It fixes "not found" errors when removing a big object with a predefined session (from a file). Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
f48b1de54b
commit
c85bea15ef
1 changed files with 6 additions and 0 deletions
|
@ -225,6 +225,12 @@ func ReadOrOpenSessionViaClient(cmd *cobra.Command, dst SessionPrm, cli *client.
|
|||
var objs []oid.ID
|
||||
if obj != nil {
|
||||
objs = []oid.ID{*obj}
|
||||
|
||||
if _, ok := dst.(*internal.DeleteObjectPrm); ok {
|
||||
common.PrintVerbose("Collecting relatives of the removal object...")
|
||||
|
||||
objs = append(objs, collectObjectRelatives(cmd, cli, cnr, *obj)...)
|
||||
}
|
||||
}
|
||||
|
||||
finalizeSession(cmd, dst, tok, key, cnr, objs...)
|
||||
|
|
Loading…
Reference in a new issue