mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
fix: Skip always-running nodes in start_all/stop_all
Always-running node types (Ethernet switch, Cloud, NAT, etc.) return 405 when start/stop is called. is_always_running() already tracks these types; start_all/stop_all now skip them.
This commit is contained in:
parent
3db275b199
commit
9d7c482288
@ -1532,21 +1532,23 @@ class Project:
|
||||
@open_required
|
||||
async def start_all(self):
|
||||
"""
|
||||
Start all nodes
|
||||
Start all nodes (except always-running types like Ethernet switch, Cloud, NAT, etc.)
|
||||
"""
|
||||
pool = Pool(concurrency=3)
|
||||
for node in self.nodes.values():
|
||||
pool.append(node.start)
|
||||
if not node.is_always_running():
|
||||
pool.append(node.start)
|
||||
await pool.join()
|
||||
|
||||
@open_required
|
||||
async def stop_all(self):
|
||||
"""
|
||||
Stop all nodes
|
||||
Stop all nodes (except always-running types like Ethernet switch, Cloud, NAT, etc.)
|
||||
"""
|
||||
pool = Pool(concurrency=3)
|
||||
for node in self.nodes.values():
|
||||
pool.append(node.stop)
|
||||
if not node.is_always_running():
|
||||
pool.append(node.stop)
|
||||
await pool.join()
|
||||
|
||||
@open_required
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user