flame: set node name

if it doesn't exists in node props then set it from node_id
This commit is contained in:
Jakub Jezek 2022-04-07 15:22:09 +02:00
parent 304584573b
commit 16bd11083d
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -107,7 +107,7 @@ def create_batch_group_conent(batch_nodes, batch_links, batch_group=None):
node["id"], node["type"], node["properties"])
# get node name for checking if exists
node_name = node_props.get("name") or node_id
node_name = node_props.pop("name", None) or node_id
if all_batch_nodes.get(node_name):
# update existing batch node
@ -116,6 +116,9 @@ def create_batch_group_conent(batch_nodes, batch_links, batch_group=None):
# create new batch node
batch_node = batch_group.create_node(node_type)
# set name
setattr(batch_node, "name", node_name)
# set attributes found in node props
for key, value in node_props.items():
if not hasattr(batch_node, key):