mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Move running project check before fast duplication
Move the is_running() check from _fast_duplication() to duplicate() to avoid the error message being wrapped by the except Exception handler. This ensures the error message is clean and prevents wasted fast duplication attempts on running projects.
This commit is contained in:
1 file changed
+3
@@ -1334,6 +1334,9 @@ class Project:
|
|||||||
self.dump()
|
self.dump()
|
||||||
assert self._status != "closed"
|
assert self._status != "closed"
|
||||||
|
|
||||||
|
if self.is_running():
|
||||||
|
raise ControllerError("Project must be stopped in order to duplicate it")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proj = await self._fast_duplication(name, reset_mac_addresses)
|
proj = await self._fast_duplication(name, reset_mac_addresses)
|
||||||
if proj:
|
if proj:
|
||||||
|
|||||||
Reference in new issue
Block a user