From 03a134af75059de7d409e26e55b3348fc5e2473e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 7 Apr 2017 15:33:22 +0200 Subject: [PATCH] Catch an error at startup when the remote GNS3 VM is not a real GNS3 VM --- gns3server/controller/gns3vm/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gns3server/controller/gns3vm/__init__.py b/gns3server/controller/gns3vm/__init__.py index 73a759fb..bace3022 100644 --- a/gns3server/controller/gns3vm/__init__.py +++ b/gns3server/controller/gns3vm/__init__.py @@ -18,6 +18,7 @@ import sys import copy import asyncio +import aiohttp from ...utils.asyncio import locked_coroutine from .vmware_gns3_vm import VMwareGNS3VM @@ -242,10 +243,13 @@ class GNS3VM: yield from self.start() except GNS3VMError as e: # User will receive the error later when they will try to use the node - yield from self._controller.add_compute(compute_id="vm", - name="GNS3 VM ({})".format(self.current_engine().vmname), - host=None, - force=True) + try: + yield from self._controller.add_compute(compute_id="vm", + name="GNS3 VM ({})".format(self.current_engine().vmname), + host=None, + force=True) + except aiohttp.web.HTTPConflict: + pass log.error("Can't start the GNS3 VM: {}", str(e)) @asyncio.coroutine