Ensure snapshot name does not already exist
This commit is contained in:
parent
3d0d5e63f6
commit
359191c83f
|
@ -1265,6 +1265,12 @@ def create_vm_snapshot(zkhandler, domain, snapshot_name=None):
|
|||
False,
|
||||
f'ERROR: Snapshot name "{snapshot_name}" contains invalid characters; only alphanumeric, ".", "-", and "_" characters are allowed!',
|
||||
)
|
||||
current_snapshots = zkhandler.children(("domain.snapshots", dom_uuid))
|
||||
if current_snapshots and snapshot_name in current_snapshots:
|
||||
return (
|
||||
False,
|
||||
f'ERROR: Snapshot name "{snapshot_name}" already exists for VM "{domain}"!',
|
||||
)
|
||||
|
||||
tstart = time.time()
|
||||
|
||||
|
|
Loading…
Reference in New Issue