mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Merge branch 'master' into unstable
This commit is contained in:
commit
c700804014
@ -72,7 +72,6 @@ class BaseVM:
|
||||
|
||||
def __del__(self):
|
||||
|
||||
self.close()
|
||||
if self._temporary_directory is not None:
|
||||
if os.path.exists(self._temporary_directory):
|
||||
shutil.rmtree(self._temporary_directory, ignore_errors=True)
|
||||
|
@ -103,10 +103,9 @@ class Server:
|
||||
|
||||
def _signal_handling(self):
|
||||
|
||||
@asyncio.coroutine
|
||||
def signal_handler(signame):
|
||||
log.warning("Server has got signal {}, exiting...".format(signame))
|
||||
yield from self.shutdown_server()
|
||||
asyncio.async(self.shutdown_server())
|
||||
|
||||
signals = ["SIGTERM", "SIGINT"]
|
||||
if sys.platform.startswith("win"):
|
||||
@ -115,7 +114,7 @@ class Server:
|
||||
signals.extend(["SIGHUP", "SIGQUIT"])
|
||||
|
||||
for signal_name in signals:
|
||||
callback = functools.partial(asyncio.async, signal_handler(signal_name))
|
||||
callback = functools.partial(signal_handler, signal_name)
|
||||
if sys.platform.startswith("win"):
|
||||
# add_signal_handler() is not yet supported on Windows
|
||||
signal.signal(getattr(signal, signal_name), callback)
|
||||
|
Loading…
Reference in New Issue
Block a user