mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Graceful shutdown for modules and locale check for the server.
This commit is contained in:
1 parent
9be5625c38
commit
7ebd451dda
4 files changed
+52
-6
No files matched your search
@@ -54,6 +54,7 @@ class IModule(multiprocessing.Process):
|
||||
self._current_session = None
|
||||
self._current_destination = None
|
||||
self._current_call_id = None
|
||||
self._stopping = False
|
||||
|
||||
def _setup(self):
|
||||
"""
|
||||
@@ -128,13 +129,16 @@ class IModule(multiprocessing.Process):
|
||||
except KeyboardInterrupt:
|
||||
return
|
||||
|
||||
log.info("{} module has stopped".format(self.name))
|
||||
|
||||
def stop(self):
|
||||
"""
|
||||
Stops the event loop.
|
||||
"""
|
||||
|
||||
if self._ioloop:
|
||||
self._ioloop.stop()
|
||||
if not self._stopping:
|
||||
self._stopping = True
|
||||
self._ioloop.add_callback_from_signal(self._ioloop.stop)
|
||||
|
||||
def send_response(self, results):
|
||||
"""
|
||||
|
||||
@@ -442,8 +442,8 @@ class IOUDevice(object):
|
||||
self._started = True
|
||||
except OSError as e:
|
||||
iou_stdout = self.read_iou_stdout()
|
||||
log.error("could not start IOU: {}\n{}".format(e, iou_stdout))
|
||||
raise IOUError("could not start IOU: {}\n{}".format(e, iou_stdout))
|
||||
log.error("could not start IOU {}: {}\n{}".format(self._path, e, iou_stdout))
|
||||
raise IOUError("could not start IOU {}: {}\n{}".format(self._path, e, iou_stdout))
|
||||
|
||||
# start console support
|
||||
self._start_ioucon()
|
||||
|
||||
Reference in new issue
Block a user