Unverified Commit 413c0570 authored by Marvin Meiers's avatar Marvin Meiers
Browse files

symphony/orchestration: explicitly set components in fromJSON of NS3Base

Otherwise components is not set when deserializing using fromJSON, so
that accessing components will fail subsequently.
parent 94fd0178
...@@ -146,6 +146,8 @@ class NS3Base(utils_base.IdObj): ...@@ -146,6 +146,8 @@ class NS3Base(utils_base.IdObj):
@classmethod @classmethod
def fromJSON(cls, json_obj): def fromJSON(cls, json_obj):
instance = super().fromJSON(json_obj) instance = super().fromJSON(json_obj)
# NOTE MM: we set components to an empty list for now, so that the attribute is set
instance.components = []
instance.category = utils_base.get_json_attr_top(json_obj, 'category') instance.category = utils_base.get_json_attr_top(json_obj, 'category')
instance.mapping = utils_base.json_to_dict( instance.mapping = utils_base.json_to_dict(
utils_base.get_json_attr_top(json_obj, 'mapping') utils_base.get_json_attr_top(json_obj, 'mapping')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment