1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Fix crash launching qemu on OSX from another location.

It's append only when frozen an you launch the server by hand.

Fix #194
This commit is contained in:
Julien Duponchelle 2015-05-18 11:58:56 +02:00
parent 8c9758d16b
commit 9fa873751d

View File

@ -74,7 +74,11 @@ class Qemu(BaseManager):
# add specific locations on Mac OS X regardless of what's in $PATH # add specific locations on Mac OS X regardless of what's in $PATH
paths.extend(["/usr/local/bin", "/opt/local/bin"]) paths.extend(["/usr/local/bin", "/opt/local/bin"])
if hasattr(sys, "frozen"): if hasattr(sys, "frozen"):
try:
paths.append(os.path.abspath(os.path.join(os.getcwd(), "../../../qemu/bin/"))) paths.append(os.path.abspath(os.path.join(os.getcwd(), "../../../qemu/bin/")))
# If the user run the server by hand from outside
except FileNotFoundError:
paths.append(["/Applications/GNS3.app/Contents/Resources/qemu/bin"])
for path in paths: for path in paths:
try: try:
for f in os.listdir(path): for f in os.listdir(path):