]> git.proxmox.com Git - pve-storage.git/commitdiff
followup: free_image: just check if a file in general exist
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Jun 2019 09:51:27 +0000 (11:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Jun 2019 09:51:29 +0000 (11:51 +0200)
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>
PVE/Storage/Plugin.pm

index e20acb3517f2e580a8c6884f25c59a7e1eff990d..b565e92f471625e4f052f1124e147ab3282b5220 100644 (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;
        }