mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 16:28:11 +00:00
Change how VPCS executable is searched.
This commit is contained in:
parent
4c83fc1243
commit
380224dca1
@ -37,7 +37,6 @@ from gns3server.utils import parse_version
|
|||||||
from .vpcs_error import VPCSError
|
from .vpcs_error import VPCSError
|
||||||
from ..adapters.ethernet_adapter import EthernetAdapter
|
from ..adapters.ethernet_adapter import EthernetAdapter
|
||||||
from ..nios.nio_udp import NIOUDP
|
from ..nios.nio_udp import NIOUDP
|
||||||
from ..nios.nio_tap import NIOTAP
|
|
||||||
from ..base_node import BaseNode
|
from ..base_node import BaseNode
|
||||||
|
|
||||||
|
|
||||||
@ -139,12 +138,10 @@ class VPCSVM(BaseNode):
|
|||||||
:returns: path to VPCS
|
:returns: path to VPCS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
search_path = self._manager.config.get_section_config("VPCS").get("vpcs_path", "vpcs")
|
vpcs_path = self._manager.config.get_section_config("VPCS").get("vpcs_path", "vpcs")
|
||||||
path = shutil.which(search_path)
|
if not os.path.isabs(vpcs_path):
|
||||||
# shutil.which return None if the path doesn't exists
|
vpcs_path = shutil.which(vpcs_path)
|
||||||
if not path:
|
return vpcs_path
|
||||||
return search_path
|
|
||||||
return path
|
|
||||||
|
|
||||||
@BaseNode.name.setter
|
@BaseNode.name.setter
|
||||||
def name(self, new_name):
|
def name(self, new_name):
|
||||||
|
Loading…
Reference in New Issue
Block a user