Improve return messages

This commit is contained in:
Joshua Boniface 2023-10-17 12:10:55 -04:00
parent 0169510df0
commit a5d0f219e4
1 changed files with 7 additions and 3 deletions

View File

@ -1426,8 +1426,9 @@ def backup_vm(
) )
# 7. Create and dump VM backup information # 7. Create and dump VM backup information
backup_type = "incremental" if incremental_parent is not None else "full"
vm_backup = { vm_backup = {
"type": "incremental" if incremental_parent is not None else "full", "type": backup_type,
"datestring": datestring, "datestring": datestring,
"incremental_parent": incremental_parent, "incremental_parent": incremental_parent,
"vm_detail": vm_detail, "vm_detail": vm_detail,
@ -1454,7 +1455,10 @@ def backup_vm(
if is_snapshot_remove_failed: if is_snapshot_remove_failed:
return ( return (
True, True,
f'WARNING: Successfully backed up VM {domain} @ {datestring} to {target_path}, but failed to remove snapshot as requested for volume(s) {", ".join(which_snapshot_remove_failed)}: {", ".join(msg_snapshot_remove_failed)}', f'WARNING: Successfully backed up VM {domain} ({backup_type}@{datestring}) to {target_path}, but failed to remove snapshot as requested for volume(s) {", ".join(which_snapshot_remove_failed)}: {", ".join(msg_snapshot_remove_failed)}',
) )
return True, f"Successfully backed up VM {domain} @ {datestring} to {target_path}" return (
True,
f"Successfully backed up VM {domain} ({backup_type}@{datestring}) to {target_path}",
)