]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/DirPlugin.pm
fix prune-backups validation (again)
[pve-storage.git] / PVE / Storage / DirPlugin.pm
index 7bb85e824194f02b3bde600df8ac01eb806d8189..2267f117c963e3e7a05a00f4a563149c5aca8163 100644 (file)
@@ -107,8 +107,11 @@ sub update_volume_notes {
     my $path = $class->filesystem_path($scfg, $volname);
     $path .= $class->SUPER::NOTES_EXT;
 
-    PVE::Tools::file_set_contents($path, $notes);
-
+    if (defined($notes) && $notes ne '') {
+       PVE::Tools::file_set_contents($path, $notes);
+    } else {
+       unlink $path or die "could not delete notes - $!\n";
+    }
     return;
 }