From da8811515ddd7a7d96b9be76ea3e8bc9bbafc535 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 28 Feb 2017 11:42:07 +0100 Subject: [PATCH] Remove noise from log when VMware is not installed --- gns3server/controller/gns3vm/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/gns3vm/__init__.py b/gns3server/controller/gns3vm/__init__.py index e069e2dc..73a759fb 100644 --- a/gns3server/controller/gns3vm/__init__.py +++ b/gns3server/controller/gns3vm/__init__.py @@ -222,8 +222,14 @@ class GNS3VM: """ engine = self._get_engine(engine) vms = [] - for vm in (yield from engine.list()): - vms.append({"vmname": vm["vmname"]}) + try: + for vm in (yield from engine.list()): + vms.append({"vmname": vm["vmname"]}) + except GNS3VMError as e: + # We raise error only if user activated the GNS3 VM + # otherwise you have noise when VMware is not installed + if self.enable: + raise e return vms @asyncio.coroutine