Merge branch '2.1' into 2.2

# Conflicts:
#	gns3server/compute/docker/docker_vm.py
#	gns3server/controller/compute.py
#	gns3server/controller/gns3vm/__init__.py
#	gns3server/controller/link.py
#	gns3server/controller/project.py
#	gns3server/handlers/api/controller/project_handler.py
#	gns3server/handlers/api/controller/server_handler.py
#	gns3server/utils/asyncio/__init__.py
#	gns3server/utils/asyncio/telnet_server.py
#	gns3server/version.py
#	gns3server/web/web_server.py
#	tests/compute/qemu/test_qemu_vm.py
This commit is contained in:
grossmj committed 2018-08-29 15:57:54 +07:00
commit 33e8710495
43 files changed
+362 -193

No files matched your search

+18 -10
View File
@@ -21,7 +21,7 @@ import asyncio
import aiohttp
import ipaddress
from ...utils.asyncio import locked_coroutine, asyncio_ensure_future
from ...utils.asyncio import locking, asyncio_ensure_future
from .vmware_gns3_vm import VMwareGNS3VM
from .virtualbox_gns3_vm import VirtualBoxGNS3VM
from .hyperv_gns3_vm import HyperVGNS3VM
@@ -278,13 +278,15 @@ class GNS3VM:
except GNS3VMError as e:
# User will receive the error later when they will try to use the node
try:
yield from self._controller.add_compute(compute_id="vm",
name="GNS3 VM ({})".format(self.current_engine().vmname),
host=None,
force=True)
compute = yield from self._controller.add_compute(compute_id="vm",
name="GNS3 VM ({})".format(self.current_engine().vmname),
host=None,
force=True)
compute.set_last_error(str(e))
except aiohttp.web.HTTPConflict:
pass
log.error("Can't start the GNS3 VM: %s", str(e))
log.error("Cannot start the GNS3 VM: {}".format(e))
@asyncio.coroutine
def exit_vm(self):
@@ -298,7 +300,8 @@ class GNS3VM:
except GNS3VMError as e:
log.warning(str(e))
@locked_coroutine
@locking
@asyncio.coroutine
def start(self):
"""
Start the GNS3 VM
@@ -323,8 +326,9 @@ class GNS3VM:
yield from engine.start()
except Exception as e:
yield from self._controller.delete_compute("vm")
log.error("Can't start the GNS3 VM: {}".format(str(e)))
log.error("Cannot start the GNS3 VM: {}".format(str(e)))
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname))
compute.set_last_error(str(e))
raise e
yield from compute.connect() # we can connect now that the VM has started
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname),
@@ -370,8 +374,11 @@ class GNS3VM:
self._controller.notification.controller_emit("log.warning", {"message": msg})
except ComputeError as e:
log.warning("Could not check the VM is in the same subnet as the local server: {}".format(e))
except aiohttp.web.HTTPConflict as e:
log.warning("Could not check the VM is in the same subnet as the local server: {}".format(e.text))
@locked_coroutine
@locking
@asyncio.coroutine
def _suspend(self):
"""
Suspend the GNS3 VM
@@ -383,7 +390,8 @@ class GNS3VM:
log.info("Suspend the GNS3 VM")
yield from engine.suspend()
@locked_coroutine
@locking
@asyncio.coroutine
def _stop(self):
"""
Stop the GNS3 VM