mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Refactor asyncio locking system for Python 3.7 support. Ref https://github.com/GNS3/gns3-gui/issues/2566 Ref https://github.com/GNS3/gns3-gui/issues/2568
This commit is contained in:
1 parent
ad9b6f42bf
commit
902de3dd47
12 files changed
+57
-42
No files matched your search
@@ -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 .remote_gns3_vm import RemoteGNS3VM
|
||||
@@ -265,7 +265,8 @@ class GNS3VM:
|
||||
except GNS3VMError as e:
|
||||
log.warn(str(e))
|
||||
|
||||
@locked_coroutine
|
||||
@locking
|
||||
@asyncio.coroutine
|
||||
def start(self):
|
||||
"""
|
||||
Start the GNS3 VM
|
||||
@@ -339,7 +340,8 @@ class GNS3VM:
|
||||
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
|
||||
@@ -351,7 +353,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
|
||||
|
||||
Reference in new issue
Block a user