]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/DirPlugin.pm
dir plugin: update notes: don't fail if file is already removed
[pve-storage.git] / PVE / Storage / DirPlugin.pm
index 3eeec9813f448f19a20e4884fc00ff49ab9b75df..1fcb8ce0b6167c806eba38adca2a7fe4a68c0d61 100644 (file)
@@ -2,8 +2,11 @@ package PVE::Storage::DirPlugin;
 
 use strict;
 use warnings;
+
 use Cwd;
 use File::Path;
+use POSIX;
+
 use PVE::Storage::Plugin;
 use PVE::JSONSchema qw(get_standard_option);
 
@@ -111,7 +114,7 @@ sub update_volume_notes {
     if (defined($notes) && $notes ne '') {
        PVE::Tools::file_set_contents($path, $notes);
     } else {
-       unlink $path or die "could not delete notes - $!\n";
+       unlink $path or $! == ENOENT or die "could not delete notes - $!\n";
     }
     return;
 }