mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-25 01:38:08 +00:00
parent
a4023c0298
commit
796ebf7210
@ -58,6 +58,13 @@ class BaseManager:
|
|||||||
self._port_manager = None
|
self._port_manager = None
|
||||||
self._config = Config.instance()
|
self._config = Config.instance()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nodes(self):
|
||||||
|
"""
|
||||||
|
List of nodes manage by the module
|
||||||
|
"""
|
||||||
|
return self._nodes.values()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def instance(cls):
|
def instance(cls):
|
||||||
"""
|
"""
|
||||||
|
@ -278,10 +278,20 @@ class Project:
|
|||||||
Closes the project, but keep information on disk
|
Closes the project, but keep information on disk
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
project_nodes_id = set([n.id for n in self.nodes])
|
||||||
|
|
||||||
for module in self.compute():
|
for module in self.compute():
|
||||||
|
module_nodes_id = set([n.id for n in module.instance().nodes])
|
||||||
|
# We close the project only for the modules using it
|
||||||
|
if len(module_nodes_id & project_nodes_id):
|
||||||
yield from module.instance().project_closing(self)
|
yield from module.instance().project_closing(self)
|
||||||
|
|
||||||
yield from self._close_and_clean(False)
|
yield from self._close_and_clean(False)
|
||||||
|
|
||||||
for module in self.compute():
|
for module in self.compute():
|
||||||
|
module_nodes_id = set([n.id for n in module.instance().nodes])
|
||||||
|
# We close the project only for the modules using it
|
||||||
|
if len(module_nodes_id & project_nodes_id):
|
||||||
yield from module.instance().project_closed(self)
|
yield from module.instance().project_closed(self)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user