followup: free_image: just check if a file in general exist

don't require any specific file types, if something is here which can
be requested to delete over API/CLI it either comes from an API/CLI
operation and should be thus OK to delete, else a user caused the
creation of the special file and it either works and all is good or
the user gets notified as we check if unlink succeeded anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2019-06-17 11:51:27 +02:00
parent 26f14f6b07
commit f6f22cb3a2

View File

@ -689,8 +689,7 @@ sub free_image {
if (defined($format) && ($format eq 'subvol')) {
File::Path::remove_tree($path);
} else {
if (! (-f $path || -l $path)) {
if (! -e $path) {
warn "disk image '$path' does not exists\n";
return undef;
}