From 7002b026fc10dd5b1d10a1f95163453fc43cf207 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 20 May 2020 18:42:50 +0930 Subject: [PATCH] Catch VirtualBox errors when listing VMs. Fixes #1759 --- gns3server/controller/gns3vm/virtualbox_gns3_vm.py | 7 +++++-- gns3server/controller/gns3vm/vmware_gns3_vm.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py index 9a656955..bef509dc 100644 --- a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py +++ b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py @@ -212,8 +212,11 @@ class VirtualBoxGNS3VM(BaseGNS3VM): List all VirtualBox VMs """ - await self._check_requirements() - return await self._virtualbox_manager.list_vms() + try: + await self._check_requirements() + return await self._virtualbox_manager.list_vms() + except VirtualBoxError as e: + raise GNS3VMError("Could not list VirtualBox VMs: {}".format(str(e))) async def start(self): """ diff --git a/gns3server/controller/gns3vm/vmware_gns3_vm.py b/gns3server/controller/gns3vm/vmware_gns3_vm.py index f061ff0a..a7a03e8e 100644 --- a/gns3server/controller/gns3vm/vmware_gns3_vm.py +++ b/gns3server/controller/gns3vm/vmware_gns3_vm.py @@ -115,6 +115,7 @@ class VMwareGNS3VM(BaseGNS3VM): """ List all VMware VMs """ + try: return (await self._vmware_manager.list_vms()) except VMwareError as e: