Further improve return messages
This commit is contained in:
parent
67b0b19bca
commit
3d12915989
|
@ -1458,12 +1458,16 @@ def backup_vm(
|
||||||
ttot = round(tend - tstart, 2)
|
ttot = round(tend - tstart, 2)
|
||||||
|
|
||||||
if is_snapshot_remove_failed:
|
if is_snapshot_remove_failed:
|
||||||
return (
|
retmsg = (
|
||||||
True,
|
f"WARNING: Successfully backed up VM '{domain}' ({backup_type} @ {datestring}) to '{target_path}' in {ttot} seconds, 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} in {ttot} seconds, but failed to remove snapshot as requested for volume(s) {", ".join(which_snapshot_remove_failed)}: {", ".join(msg_snapshot_remove_failed)}',
|
)
|
||||||
|
elif retain_snapshots:
|
||||||
|
retmsg = (
|
||||||
|
f"Successfully backed up VM '{domain}' ({backup_type} @ {datestring}, snapshots retained) to '{target_path}' in {ttot} seconds.",
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
retmsg = (
|
||||||
|
f"Successfully backed up VM '{domain}' ({backup_type} @ {datestring}) to '{target_path}' in {ttot} seconds.",
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (True, retmsg)
|
||||||
True,
|
|
||||||
f"Successfully backed up VM {domain} ({backup_type} @ {datestring}) to {target_path} in {ttot} seconds.",
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue