mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-20 16:20:18 +00:00
Merge branch '2.2' into 3.0
# Conflicts: # gns3server/compute/qemu/qemu_vm.py # gns3server/handlers/api/compute/server_handler.py # gns3server/utils/path.py # gns3server/version.py # requirements.txt # tests/compute/qemu/test_qemu_vm.py # tests/compute/test_manager.py
This commit is contained in:
@ -25,6 +25,7 @@ from .compute import ComputeConflict, ComputeError
|
||||
from .controller_error import ControllerError, ControllerTimeoutError
|
||||
from .ports.port_factory import PortFactory, StandardPortFactory, DynamipsPortFactory
|
||||
from ..utils.images import images_directories
|
||||
from ..config import Config
|
||||
from ..utils.qt import qt_font_to_style
|
||||
|
||||
|
||||
@ -293,10 +294,12 @@ class Node:
|
||||
if val is None:
|
||||
val = ":/symbols/computer.svg"
|
||||
|
||||
# No abs path, fix them (bug of 1.X)
|
||||
try:
|
||||
if not val.startswith(":") and os.path.abspath(val):
|
||||
val = os.path.basename(val)
|
||||
if not val.startswith(":") and os.path.isabs(val):
|
||||
server_config = Config.instance().get_section_config("Server")
|
||||
default_symbol_directory = os.path.expanduser(server_config.get("images_path", "~/GNS3/symbols"))
|
||||
if os.path.commonprefix([default_symbol_directory, val]) != default_symbol_directory:
|
||||
val = os.path.basename(val)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
Reference in New Issue
Block a user