From feefb075d47463c6d8b22abf3196c059c44e9826 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 26 Jun 2015 15:10:41 +0200 Subject: [PATCH] Make the qemu event crash more future proof --- gns3server/modules/qemu/qemu_vm.py | 2 +- tests/modules/qemu/test_qemu_vm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index 01dc5de5..067ed71c 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -734,7 +734,7 @@ class QemuVM(BaseVM): self.status = "stopped" self._process = None if returncode != 0: - self.project.emit("log.error", "QEMU process has stopped, return code: {}\n{}".format(returncode, self.read_stdout())) + self.project.emit("log.error", {"message": "QEMU process has stopped, return code: {}\n{}".format(returncode, self.read_stdout())}) @asyncio.coroutine def stop(self): diff --git a/tests/modules/qemu/test_qemu_vm.py b/tests/modules/qemu/test_qemu_vm.py index 55700f22..ef9734dd 100644 --- a/tests/modules/qemu/test_qemu_vm.py +++ b/tests/modules/qemu/test_qemu_vm.py @@ -148,7 +148,7 @@ def test_termination_callback_error(vm, tmpdir): (action, event) = queue.get_nowait() assert action == "log.error" - assert event == "QEMU process has stopped, return code: 1\nBOOMM" + assert event["message"] == "QEMU process has stopped, return code: 1\nBOOMM" def test_reload(loop, vm):