In case of a ZFS volume the message would be a rather unhelpful: > zfs error: could not find any snapshots to destroy; check snapshot names.
Mention the volume name and that the force parameter can be used if desired. Signed-off-by: Fiona Ebner <[email protected]> --- src/PVE/AbstractConfig.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm index d403021..23f62d4 100644 --- a/src/PVE/AbstractConfig.pm +++ b/src/PVE/AbstractConfig.pm @@ -1014,8 +1014,11 @@ sub snapshot_delete { ); }; if (my $err = $@) { - die $err if !$force; - warn $err; + my $volid_key = $class->volid_key(); + my $volid = $volume->{$volid_key}; + my $msg = "Removing snapshot '$snapname' from volume $volid failed"; + die "${msg}, use '--force' to continue removal. Error was: $err" if !$force; + warn "${msg}, proceeding because '--force' was specified. Error was: $err"; } } -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
