Rename __json__() to asdict()

This commit is contained in:
grossmj
2021-04-17 23:34:28 +09:30
parent 44074ff7c9
commit cefab8d362
89 changed files with 286 additions and 282 deletions

View File

@ -1112,7 +1112,7 @@ class QemuVM(BaseNode):
# In case user upload image manually we don't have md5 sums.
# We need generate hashes at this point, otherwise they will be generated
# at __json__ but not on separate thread.
# at asdict but not on separate thread.
await cancellable_wait_run_in_executor(md5sum, self._hda_disk_image)
await cancellable_wait_run_in_executor(md5sum, self._hdb_disk_image)
await cancellable_wait_run_in_executor(md5sum, self._hdc_disk_image)
@ -2506,7 +2506,7 @@ class QemuVM(BaseNode):
raise QemuError(f"Invalid additional options: {additional_options} error {e}")
return command
def __json__(self):
def asdict(self):
answer = {"project_id": self.project.id, "node_id": self.id, "node_directory": self.working_path}
# Qemu has a long list of options. The JSON schema is the single source of information
for field in Qemu.schema()["properties"]: