mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Conservative approach to supported versions of Python 3.4 and asyncio.ensure_future, Ref. #1269
This commit is contained in:
1 parent
3c5ca9ce0e
commit
eeae07e783
18 files changed
+60
-39
No files matched your search
@@ -36,6 +36,8 @@ from ..compute.port_manager import PortManager
|
||||
from ..compute.qemu import Qemu
|
||||
from ..controller import Controller
|
||||
|
||||
from gns3server.utils.asyncio import asyncio_ensure_future
|
||||
|
||||
# do not delete this import
|
||||
import gns3server.handlers
|
||||
|
||||
@@ -136,7 +138,7 @@ class WebServer:
|
||||
|
||||
def signal_handler(signame, *args):
|
||||
log.warning("Server has got signal {}, exiting...".format(signame))
|
||||
asyncio.ensure_future(self.shutdown_server())
|
||||
asyncio_ensure_future(self.shutdown_server())
|
||||
|
||||
signals = ["SIGTERM", "SIGINT"]
|
||||
if sys.platform.startswith("win"):
|
||||
@@ -203,7 +205,7 @@ class WebServer:
|
||||
# Because with a large image collection
|
||||
# without md5sum already computed we start the
|
||||
# computing with server start
|
||||
asyncio.ensure_future(Qemu.instance().list_images())
|
||||
asyncio_ensure_future(Qemu.instance().list_images())
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
@@ -283,7 +285,7 @@ class WebServer:
|
||||
self._exit_handling()
|
||||
|
||||
if server_config.getboolean("shell"):
|
||||
asyncio.ensure_future(self.start_shell())
|
||||
asyncio_ensure_future(self.start_shell())
|
||||
|
||||
try:
|
||||
self._loop.run_forever()
|
||||
|
||||
Reference in new issue
Block a user