mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-29 02:08:10 +00:00
Check if the VirtualBox COM service is installed on Windows.
This commit is contained in:
parent
ea05744e1c
commit
77c583ca39
@ -55,10 +55,6 @@ class C7200(Router):
|
||||
if npe != "npe-400":
|
||||
self.npe = npe
|
||||
|
||||
if parse_version(hypervisor.version) <= parse_version('0.2.13'):
|
||||
# work around a bug when rebooting a router with NPE-400 in Dynamips <= 0.2.13
|
||||
self.npe = "npe-200"
|
||||
|
||||
# 4 sensors with a default temperature of 22C:
|
||||
# sensor 1 = I/0 controller inlet
|
||||
# sensor 2 = I/0 controller outlet
|
||||
|
@ -107,13 +107,20 @@ class VirtualBox(IModule):
|
||||
|
||||
if sys.platform.startswith("win"):
|
||||
import win32com.client
|
||||
|
||||
if win32com.client.gencache.is_readonly is True:
|
||||
# dynamically generate the cache
|
||||
# http://www.py2exe.org/index.cgi/IncludingTypelibs
|
||||
# http://www.py2exe.org/index.cgi/UsingEnsureDispatch
|
||||
win32com.client.gencache.is_readonly = False
|
||||
win32com.client.gencache.Rebuild()
|
||||
#win32com.client.gencache.Rebuild()
|
||||
win32com.client.gencache.GetGeneratePath()
|
||||
|
||||
try:
|
||||
win32com.client.gencache.EnsureDispatch("VirtualBox.VirtualBox")
|
||||
except:
|
||||
raise VirtualBoxError("VirtualBox is not installed.")
|
||||
|
||||
try:
|
||||
from .vboxapi_py3 import VirtualBoxManager
|
||||
self._vboxmanager = VirtualBoxManager(None, None)
|
||||
@ -749,7 +756,11 @@ class VirtualBox(IModule):
|
||||
"""
|
||||
|
||||
if not self._vboxwrapper and not self._vboxmanager:
|
||||
self._start_vbox_service()
|
||||
try:
|
||||
self._start_vbox_service()
|
||||
except VirtualBoxError as e:
|
||||
self.send_custom_error(str(e))
|
||||
return
|
||||
|
||||
if self._vboxwrapper:
|
||||
vms = self._vboxwrapper.get_vm_list()
|
||||
|
Loading…
Reference in New Issue
Block a user