mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
1 parent
c361d27531
commit
d853ffe791
3 files changed
+11
-6
No files matched your search
@@ -70,9 +70,9 @@ class Qemu(BaseManager):
|
||||
if "PROGRAMFILES" in os.environ and os.path.exists(os.environ["PROGRAMFILES"]):
|
||||
paths.add(os.path.join(os.environ["PROGRAMFILES"], "qemu"))
|
||||
elif sys.platform.startswith("darwin"):
|
||||
# add specific locations on Mac OS X regardless of what's in $PATH
|
||||
paths.update(["/usr/bin", "/usr/local/bin", "/opt/local/bin"])
|
||||
if hasattr(sys, "frozen"):
|
||||
# add specific locations on Mac OS X regardless of what's in $PATH
|
||||
paths.update(["/usr/bin", "/usr/local/bin", "/opt/local/bin"])
|
||||
try:
|
||||
exec_dir = os.path.dirname(os.path.abspath(sys.executable))
|
||||
paths.add(os.path.abspath(os.path.join(exec_dir, "../Resources/qemu/bin/")))
|
||||
|
||||
@@ -142,7 +142,10 @@ class QemuVM(BaseVM):
|
||||
"""
|
||||
|
||||
if qemu_path and os.pathsep not in qemu_path:
|
||||
qemu_path = shutil.which(qemu_path)
|
||||
new_qemu_path = shutil.which(qemu_path, path=os.pathsep.join(self._manager.paths_list()))
|
||||
if new_qemu_path is None:
|
||||
raise QemuError("QEMU binary path {} is not found in the path".format(qemu_path))
|
||||
qemu_path = new_qemu_path
|
||||
|
||||
self._check_qemu_path(qemu_path)
|
||||
self._qemu_path = qemu_path
|
||||
@@ -161,7 +164,7 @@ class QemuVM(BaseVM):
|
||||
|
||||
def _check_qemu_path(self, qemu_path):
|
||||
if qemu_path is None:
|
||||
raise QemuError("QEMU binary path is not set or not found in the path")
|
||||
raise QemuError("QEMU binary path is not set")
|
||||
if not os.path.exists(qemu_path):
|
||||
raise QemuError("QEMU binary '{}' is not accessible".format(qemu_path))
|
||||
if not os.access(qemu_path, os.X_OK):
|
||||
|
||||
Reference in new issue
Block a user