[#311] control: Fix loss of parent attribute keys in netmap converter

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-15 16:06:02 +03:00 committed by Alex Vanin
parent 6c9dab481c
commit c75a828adf

View file

@ -82,6 +82,15 @@ func attributesFromAPI(apiAttrs []*netmapAPI.NodeAttribute) []*control.NodeInfo_
a.SetKey(apiAttr.Key())
a.SetValue(apiAttr.Value())
apiParents := apiAttr.ParentKeys()
parents := make([]string, 0, len(apiParents))
for i := range apiParents {
parents = append(parents, apiParents[i])
}
a.SetParents(parents)
attrs = append(attrs, a)
}