mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fix issue preventing to use custom nested symbols. Fixes #1969
This commit is contained in:
parent
e026c1e91f
commit
6f1feed265
@ -25,6 +25,7 @@ import os
|
|||||||
from .compute import ComputeConflict, ComputeError
|
from .compute import ComputeConflict, ComputeError
|
||||||
from .ports.port_factory import PortFactory, StandardPortFactory, DynamipsPortFactory
|
from .ports.port_factory import PortFactory, StandardPortFactory, DynamipsPortFactory
|
||||||
from ..utils.images import images_directories
|
from ..utils.images import images_directories
|
||||||
|
from ..config import Config
|
||||||
from ..utils.qt import qt_font_to_style
|
from ..utils.qt import qt_font_to_style
|
||||||
|
|
||||||
|
|
||||||
@ -263,10 +264,12 @@ class Node:
|
|||||||
if val is None:
|
if val is None:
|
||||||
val = ":/symbols/computer.svg"
|
val = ":/symbols/computer.svg"
|
||||||
|
|
||||||
# No abs path, fix them (bug of 1.X)
|
|
||||||
try:
|
try:
|
||||||
if not val.startswith(":") and os.path.abspath(val):
|
if not val.startswith(":") and os.path.isabs(val):
|
||||||
val = os.path.basename(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:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user