Unverified Commit 313bcc7e authored by Marvin Meiers's avatar Marvin Meiers
Browse files

symphony/orchestration: do not set type and module in toJSON

Do not set the type and module field in the toJSON methods of the IdObj
sublasses, since this is already done in the base class.
parent 6caecdfe
......@@ -99,8 +99,6 @@ class Simulator(utils_base.IdObj, abc.ABC):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["name"] = self.name
json_obj["executable"] = self._executable
json_obj["simulation"] = self._simulation.id()
......@@ -322,8 +320,6 @@ class Simulation(utils_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["name"] = self.name
json_obj["metadata"] = self.metadata
......
......@@ -44,8 +44,6 @@ class Channel(utils_base.IdObj):
def toJSON(self):
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["synchronized"] = self._synchronized
json_obj["sync_period"] = self.sync_period
json_obj["sys_channel"] = self.sys_channel.id()
......
......@@ -87,8 +87,6 @@ class System(util_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
components_json = []
for _, comp in self._all_components.items():
......@@ -154,8 +152,6 @@ class Component(util_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["system"] = self.system.id()
json_obj["name"] = self.name
json_obj["parameters"] = util_base.dict_to_json(self.parameters)
......@@ -234,8 +230,6 @@ class Interface(util_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["component"] = self.component.id()
json_obj["channel"] = self.channel.id()
return json_obj
......@@ -287,8 +281,6 @@ class Channel(util_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["latency"] = self.latency
json_obj["interface_a"] = self.a.id()
json_obj["interface_b"] = self.b.id()
......
......@@ -42,8 +42,6 @@ class Application(utils_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["host"] = self.host.id()
json_obj["parameters"] = utils_base.dict_to_json(self.parameters)
return json_obj
......
......@@ -93,8 +93,6 @@ class DiskImage(utils_base.IdObj):
def toJSON(self) -> dict:
json_obj = super().toJSON()
json_obj["type"] = self.__class__.__name__
json_obj["module"] = self.__class__.__module__
json_obj["host"] = self.host.id()
json_obj["qemu_img_exec"] = self._qemu_img_exec
return json_obj
......
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