mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Cleanup VMS when leaving
This commit is contained in:
1 parent
e12e6044dc
commit
08b2dc6369
4 files changed
+21
-10
No files matched your search
@@ -77,7 +77,10 @@ class Server:
|
||||
Cleanup the modules (shutdown running emulators etc.)
|
||||
"""
|
||||
|
||||
# TODO: clean everything from here
|
||||
for module in MODULES:
|
||||
log.debug("Unloading module {}".format(module.__name__))
|
||||
m = module.instance()
|
||||
m.destroy()
|
||||
self._loop.stop()
|
||||
|
||||
def _signal_handling(self):
|
||||
@@ -152,8 +155,4 @@ class Server:
|
||||
|
||||
# FIXME: remove it in production or in tests
|
||||
self._loop.call_later(1, self._reload_hook)
|
||||
try:
|
||||
self._loop.run_forever()
|
||||
except KeyboardInterrupt:
|
||||
log.info("\nExiting...")
|
||||
self._cleanup()
|
||||
self._loop.run_forever()
|
||||
Reference in new issue
Block a user