Skip to content

Commit

Permalink
Improved generation of cluster from an object: all values (properties…
Browse files Browse the repository at this point in the history
…) not directly useful for the context of the current schema in MONARC are assigned to the key 'meta'
  • Loading branch information
cedricbonhomme committed Apr 6, 2020
1 parent 1338b70 commit 33c0806
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mosp/web/lib/objects_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def generate_misp_galaxy_cluster(json_object):
for value in json_object.json_object.get("values", []):
cluster["values"].append(
{
"uuid": value.get("uuid", ""),
"value": value.get("code", ""),
"description": value.get("label")
if value.get("label", False)
else value.get("description", ""),
"meta": {},
"uuid": value.pop("uuid", ""),
"value": value.pop("code", ""),
"description": value.pop("label")
if value.get("label", False)
else value.pop("description", ""),
"meta": value,
}
)
return (galaxy, cluster)
Expand Down

0 comments on commit 33c0806

Please sign in to comment.