mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Use Pydantic to validate the server config file.
This commit is contained in:
1 parent
478119b40d
commit
30ebae207f
61 files changed
+871
-695
No files matched your search
@@ -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