mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-22 08:50:09 +00:00
Use Pydantic to validate the server config file.
This commit is contained in:
@ -413,9 +413,6 @@ class Project:
|
||||
|
||||
self._path = path
|
||||
|
||||
def _config(self):
|
||||
return Config.instance().get_section_config("Server")
|
||||
|
||||
@property
|
||||
def captures_directory(self):
|
||||
"""
|
||||
@ -870,8 +867,8 @@ class Project:
|
||||
depending of the operating system
|
||||
"""
|
||||
|
||||
server_config = Config.instance().get_section_config("Server")
|
||||
path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
|
||||
server_config = Config.instance().settings.Server
|
||||
path = os.path.expanduser(server_config.projects_path)
|
||||
path = os.path.normpath(path)
|
||||
try:
|
||||
os.makedirs(path, exist_ok=True)
|
||||
|
Reference in New Issue
Block a user