mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-29 02:08:10 +00:00
Improve checks when starting IOU.
This commit is contained in:
parent
4ab9b4acc7
commit
fca399a5ab
@ -127,8 +127,8 @@ class Dynamips(IModule):
|
||||
Properly stops the module.
|
||||
"""
|
||||
|
||||
#if not sys.platform.startswith("win32"):
|
||||
# self._callback.stop()
|
||||
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
|
||||
|
@ -402,8 +402,9 @@ class IOUDevice(object):
|
||||
|
||||
log.info("iouyap started PID={}".format(self._iouyap_process.pid))
|
||||
except OSError as e:
|
||||
log.error("could not start iouyap: {}".format(e))
|
||||
raise IOUError("Could not start iouyap: {}".format(e))
|
||||
iouyap_stdout = self.read_iouyap_stdout()
|
||||
log.error("could not start iouyap: {}\n{}".format(e, iouyap_stdout))
|
||||
raise IOUError("Could not start iouyap: {}\n{}".format(e, iouyap_stdout))
|
||||
|
||||
def start(self):
|
||||
"""
|
||||
@ -411,6 +412,10 @@ class IOUDevice(object):
|
||||
"""
|
||||
|
||||
if not self.is_running():
|
||||
|
||||
if not os.path.exists(self._path):
|
||||
raise IOUError("IOU '{}' is not accessible".format(self._path))
|
||||
|
||||
if not self._iourc or not os.path.exists(self._iourc):
|
||||
raise IOUError("A iourc file is necessary to start IOU")
|
||||
|
||||
@ -435,8 +440,9 @@ class IOUDevice(object):
|
||||
log.info("IOU instance {} started PID={}".format(self._id, self._process.pid))
|
||||
self._started = True
|
||||
except OSError as e:
|
||||
log.error("could not start IOU: {}".format(e))
|
||||
raise IOUError("could not start IOU: {}".format(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))
|
||||
|
||||
# start console support
|
||||
self._start_ioucon()
|
||||
|
Loading…
Reference in New Issue
Block a user