dir plugin: update notes: don't fail if file is already removed
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
a799f7529b
commit
ddb3263031
@ -2,8 +2,11 @@ package PVE::Storage::DirPlugin;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Cwd;
|
use Cwd;
|
||||||
use File::Path;
|
use File::Path;
|
||||||
|
use POSIX;
|
||||||
|
|
||||||
use PVE::Storage::Plugin;
|
use PVE::Storage::Plugin;
|
||||||
use PVE::JSONSchema qw(get_standard_option);
|
use PVE::JSONSchema qw(get_standard_option);
|
||||||
|
|
||||||
@ -111,7 +114,7 @@ sub update_volume_notes {
|
|||||||
if (defined($notes) && $notes ne '') {
|
if (defined($notes) && $notes ne '') {
|
||||||
PVE::Tools::file_set_contents($path, $notes);
|
PVE::Tools::file_set_contents($path, $notes);
|
||||||
} else {
|
} else {
|
||||||
unlink $path or die "could not delete notes - $!\n";
|
unlink $path or $! == ENOENT or die "could not delete notes - $!\n";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user