fix #2226: allow broken symlinks to be deleted via API

Symlinks with a non-existing target fail Perls '-f' test and were thus
not deleteable via the API (failing with '$path does not exist').

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter
2019-06-17 11:05:32 +02:00
committed by Thomas Lamprecht
parent 5f73686fd3
commit 26f14f6b07

View File

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