Proper server shutdown.

This commit is contained in:
grossmj committed 2014-04-26 17:51:47 -06:00
1 parent 223407c596
commit 28ca12367a
5 files changed
+70 -27

No files matched your search

+5 -2
View File
@@ -122,16 +122,19 @@ class Dynamips(IModule):
self._callback = self.add_periodic_callback(self._check_hypervisors, 5000)
self._callback.start()
def stop(self):
def stop(self, signum=None):
"""
Properly stops the module.
:param signum: signal number (if called by the signal handler)
"""
if not sys.platform.startswith("win32"):
self._callback.stop()
if self._hypervisor_manager:
self._hypervisor_manager.stop_all_hypervisors()
IModule.stop(self) # this will stop the I/O loop
IModule.stop(self, signum) # this will stop the I/O loop
def _check_hypervisors(self):
"""