Reload a topology work

This commit is contained in:
Julien Duponchelle committed 2016-06-15 16:26:16 +02:00
1 parent 524f8991bc
commit 6d36429870
14 files changed
+167 -34

No files matched your search

+3 -3
View File
@@ -92,6 +92,7 @@ class Controller:
# Preload the list of projects from disk
server_config = Config.instance().get_section_config("Server")
projects_path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
os.makedirs(projects_path, exist_ok=True)
try:
for project_path in os.listdir(projects_path):
project_dir = os.path.join(projects_path, project_path)
@@ -101,11 +102,10 @@ class Controller:
try:
yield from self.load_project(os.path.join(project_dir, file), load=False)
except aiohttp.web_exceptions.HTTPConflict:
pass # Skip not compatible projects
pass # Skip not compatible projects
except OSError as e:
log.error(str(e))
def is_enabled(self):
"""
:returns: whether the current instance is the controller
@@ -219,7 +219,7 @@ class Controller:
project = yield from self.add_project(path=os.path.dirname(path), status="closed", **topo_data)
if load:
yield from project.load()
yield from project.open()
@property
def projects(self):