Add running project check for fast duplication

Add is_running() check at the beginning of _fast_duplication()
to prevent duplicating a project while nodes are running.
Previously, only the export/import fallback path had this check,
which meant running nodes were not detected when fast duplication
succeeded. This aligns with the duplicate API behavior and
provides a consistent safeguard against data inconsistencies.
This commit is contained in:
YueGuobin 2026-06-03 12:15:27 +08:00
parent 45b5f8d7e2
commit c4440d882d
No known key found for this signature in database

View File

@ -1404,6 +1404,10 @@ class Project:
:param reset_mac_addresses: Reset MAC addresses for the duplicated project
"""
# We don't duplicate a running project
if self.is_running():
raise ControllerError("Project must be stopped in order to duplicate it")
# remote replication is not supported with remote computes
for compute in self.computes:
if compute.id != "local":