diff --git a/gns3server/handlers/upload_handler.py b/gns3server/handlers/upload_handler.py index 429963a6..0df82392 100644 --- a/gns3server/handlers/upload_handler.py +++ b/gns3server/handlers/upload_handler.py @@ -72,4 +72,4 @@ class UploadHandler: @staticmethod def image_directory(): server_config = Config.instance().get_section_config("Server") - return os.path.expanduser(server_config.get("image_directory", "~/GNS3/images")) + return os.path.expanduser(server_config.get("images_path", "~/GNS3/images")) diff --git a/gns3server/modules/project.py b/gns3server/modules/project.py index 6aa4bf6f..11e20421 100644 --- a/gns3server/modules/project.py +++ b/gns3server/modules/project.py @@ -91,7 +91,8 @@ class Project: depending of the operating system """ - path = os.path.normpath(os.path.expanduser("~/GNS3/projects")) + server_config = Config.instance().get_section_config("Server") + path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects")) try: os.makedirs(path, exist_ok=True) except OSError as e: diff --git a/gns3server/server.py b/gns3server/server.py index 7e47a307..cb8d5b7f 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -142,9 +142,11 @@ class Server: @asyncio.coroutine def start_shell(self): - from ptpython.repl import embed - from gns3server.modules import Qemu - + try: + from ptpython.repl import embed + except ImportError: + log.error("Unable to start a shell: the ptpython module must be installed!") + return yield from embed(globals(), locals(), return_asyncio_coroutine=True, patch_stdout=True) def run(self):