From bec77f280a8531076dab7306b8d5c0c6da4d742e Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 16 Mar 2023 11:01:44 +0300 Subject: [PATCH] [#37] container: Support legacy sys attributes Signed-off-by: Denis Kirillov --- container/container.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/container/container.go b/container/container.go index 8e46340..1f5afdf 100644 --- a/container/container.go +++ b/container/container.go @@ -419,7 +419,8 @@ func DisableHomomorphicHashing(cnr *Container) { // // Zero Container has enabled hashing. func IsHomomorphicHashingDisabled(cnr Container) bool { - return cnr.Attribute(container.SysAttributeHomomorphicHashing) == attributeHomoHashEnabled + return cnr.Attribute(container.SysAttributeHomomorphicHashing) == attributeHomoHashEnabled || + cnr.Attribute(container.SysAttributeHomomorphicHashingNeoFS) == attributeHomoHashEnabled } // Domain represents information about container domain registered in the NNS @@ -465,10 +466,12 @@ func WriteDomain(cnr *Container, domain Domain) { // ReadDomain reads Domain from the Container. Returns value with empty name // if domain is not specified. func ReadDomain(cnr Container) (res Domain) { - name := cnr.Attribute(container.SysAttributeName) - if name != "" { + if name := cnr.Attribute(container.SysAttributeName); name != "" { res.SetName(name) res.SetZone(cnr.Attribute(container.SysAttributeZone)) + } else if name = cnr.Attribute(container.SysAttributeNameNeoFS); name != "" { + res.SetName(name) + res.SetZone(cnr.Attribute(container.SysAttributeZoneNeoFS)) } return