From 29ec07d1668f1310126126d250f45fa21b786356 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 18 May 2015 11:58:56 +0200 Subject: [PATCH] Fix crash launching qemu on OSX from another location. It's append only when frozen an you launch the server by hand. Fix #194 --- gns3server/modules/qemu/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/qemu/__init__.py b/gns3server/modules/qemu/__init__.py index 6dd532ba..70c1bf55 100644 --- a/gns3server/modules/qemu/__init__.py +++ b/gns3server/modules/qemu/__init__.py @@ -74,7 +74,11 @@ class Qemu(BaseManager): # add specific locations on Mac OS X regardless of what's in $PATH paths.extend(["/usr/local/bin", "/opt/local/bin"]) if hasattr(sys, "frozen"): - paths.append(os.path.abspath(os.path.join(os.getcwd(), "../../../qemu/bin/"))) + try: + 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: try: for f in os.listdir(path):