mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-30 21:03:49 +02: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":
|
if npe != "npe-400":
|
||||||
self.npe = npe
|
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:
|
# 4 sensors with a default temperature of 22C:
|
||||||
# sensor 1 = I/0 controller inlet
|
# sensor 1 = I/0 controller inlet
|
||||||
# sensor 2 = I/0 controller outlet
|
# sensor 2 = I/0 controller outlet
|
||||||
|
@ -107,13 +107,20 @@ class VirtualBox(IModule):
|
|||||||
|
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
import win32com.client
|
import win32com.client
|
||||||
|
|
||||||
if win32com.client.gencache.is_readonly is True:
|
if win32com.client.gencache.is_readonly is True:
|
||||||
# dynamically generate the cache
|
# dynamically generate the cache
|
||||||
# http://www.py2exe.org/index.cgi/IncludingTypelibs
|
# http://www.py2exe.org/index.cgi/IncludingTypelibs
|
||||||
# http://www.py2exe.org/index.cgi/UsingEnsureDispatch
|
# http://www.py2exe.org/index.cgi/UsingEnsureDispatch
|
||||||
win32com.client.gencache.is_readonly = False
|
win32com.client.gencache.is_readonly = False
|
||||||
win32com.client.gencache.Rebuild()
|
#win32com.client.gencache.Rebuild()
|
||||||
win32com.client.gencache.GetGeneratePath()
|
win32com.client.gencache.GetGeneratePath()
|
||||||
|
|
||||||
|
try:
|
||||||
|
win32com.client.gencache.EnsureDispatch("VirtualBox.VirtualBox")
|
||||||
|
except:
|
||||||
|
raise VirtualBoxError("VirtualBox is not installed.")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .vboxapi_py3 import VirtualBoxManager
|
from .vboxapi_py3 import VirtualBoxManager
|
||||||
self._vboxmanager = VirtualBoxManager(None, None)
|
self._vboxmanager = VirtualBoxManager(None, None)
|
||||||
@ -749,7 +756,11 @@ class VirtualBox(IModule):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not self._vboxwrapper and not self._vboxmanager:
|
if not self._vboxwrapper and not self._vboxmanager:
|
||||||
|
try:
|
||||||
self._start_vbox_service()
|
self._start_vbox_service()
|
||||||
|
except VirtualBoxError as e:
|
||||||
|
self.send_custom_error(str(e))
|
||||||
|
return
|
||||||
|
|
||||||
if self._vboxwrapper:
|
if self._vboxwrapper:
|
||||||
vms = self._vboxwrapper.get_vm_list()
|
vms = self._vboxwrapper.get_vm_list()
|
||||||
|
Loading…
Reference in New Issue
Block a user