1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Merge branch 'master' into unstable

This commit is contained in:
Julien Duponchelle 2015-10-12 17:09:33 +02:00
commit c700804014
2 changed files with 2 additions and 4 deletions

View File

@ -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)

View File

@ -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)