From f6f22cb3a25adaec7182746aabbc2a389681a3cb Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 17 Jun 2019 11:51:27 +0200 Subject: [PATCH] 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 --- PVE/Storage/Plugin.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index e20acb3..b565e92 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -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; }